The given resource block, seems to provide an error while applying changes. Since Amazon Inspector2 does not support lambda code scanning currently in ap-south-1 AWS region. But the given service is still enabled in the AWS account.
I am running terraform using github actions. Due to which my job fails. Any suggestion on this will be helpful
Code:
resource "aws_inspector2_enabler" "enable_audit" {
account_ids = [var.admin_account_id]
resource_types = ["ECR", "EC2"]
provider = aws.audit
lifecycle {
create_before_destroy = true
ignore_changes = [
account_ids,
resource_types
]
}
The Output:
Error: updating AWS Inspector Enabler (*******-EC2:ECR): operation error Inspector2: Disable, https response error StatusCode: 403, RequestID: ***********************, AccessDeniedException: Lambda code scanning is not supported in ap-south-1