aws_codebuild_project creation fails when dependent on aws_iam_role due to IAM eventual consistency #11709
Labels
regression
Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.
service/codebuild
Issues and PRs that pertain to the codebuild service.
service/iam
Issues and PRs that pertain to the iam service.
Milestone
Community Note
Terraform Version
Affected Resource(s)
aws_codebuild_project
when dependent onaws_iam_role
Terraform Configuration Files
Debug Output
terraform-aws-iam-eventual-consistency-codebuild.log
Panic Output
N/A
Expected Behavior
The
aws_iam_role
is created, then theaws_codebuild_project
is created.Actual Behavior
The
aws_iam_role
is created, but theaws_codebuild_project
resource fails with error.Error: Error creating CodeBuild project: InvalidInputException
. Debug log further indicates this error:CodeBuild is not authorized to perform: sts:AssumeRole on arn:aws:iam::...
I see the relevant code looks for a substring of this error message and waits up to 5 minutes. However, I can repro this issue across all of my AWS accounts. Waiting a minute and retrying clears the issue, so I believe there is something amiss with the retry logic.
Steps to Reproduce
terraform init
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: