-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CloudTrail resource creation failure when creating aws_iam_role and aws_iam_role_policy in single run #13631
Comments
I was able to confirm that this is a timing issue. I created another terraform configuration that has more resources defined in it. At first it would encounter this error but by using depends_on heavily I was able to draw the run out longer and this error does not occur. |
The issue is hit or miss in my new module. This holds us back from supporting Terraform based setup. :( https://github.com/threatstack/tf_threatstack_aws_integration |
I can also confirm this, its very easy to reproduce. I guess there needs to be a retry built into creating the cloudtrail... |
I'm experiencing the same issue. The configuration file fails the first time but successfully completes when I run it again. CloudTrail needs to wait longer for the other resources to be created. I can also confirm that this is a timing issue. I was able to get around this problem by adding the following code to my configuration file:
|
I think this is an issue that is present in lambda as well, as cloudtrail is run on lambda? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
There appears to be an issue with creating cloudtrails when the iam role for cloudwatch logs
is created in the same run. Terraform says the resource creation has completed but when creating the CloudTrail an InvalidCloudWatchLogsRoleArnException error occurs. A subsequent run completes just fine. This leads me to believe that the issue is with the IAM role policy change not being propagated across AWS fast enough for Terraform.
Terraform Version
Terraform v0.9.3
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
https://gist.github.com/0dd20ed6bc2a9dcd5c316c9d5193cdc2
Debug Output
https://gist.github.com/690acefc73b6509d89e53f389981cdd0
Expected Behavior
aws_cloudtrail is successful created
Actual Behavior
It appears that the role policy is not properly propagated by AWS before attempting to create the cloudtrail resource. A second run successfully creates wht aws_cloudtrail resource.
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: