Skip to content
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

[BUG] #4

Open
cdaniluk opened this issue May 26, 2020 · 2 comments
Open

[BUG] #4

cdaniluk opened this issue May 26, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@cdaniluk
Copy link
Contributor

Describe the bug
Timing issue causing terraform apply to fail when creating this module from scratch.

Error: Error creating CloudTrail: InsufficientS3BucketPolicyException: Incorrect S3 bucket policy is detected for bucket: 028266382041-us-east-1-cloudtrail

  on .terraform/modules/cloudtrail-logging/main.tf line 8, in resource "aws_cloudtrail" "trail":
   8: resource "aws_cloudtrail" "trail" {

To Reproduce
Create a new instance of this module. It will fail all or most of the time.

Running a second time resolves the issue.

Expected behavior
Should run on first run every time.

@cdaniluk cdaniluk added the bug Something isn't working label May 26, 2020
@sblack4
Copy link
Contributor

sblack4 commented May 26, 2020

huh, have you tried setting the dependency block in aws_cloudtrail to the IAM role? Also, should I prioritize this?

@cdaniluk
Copy link
Contributor Author

uh I didn't mean to assign this to you. It had you suggested as an assignee, but I didn't think that would assign automatically.

Pretty sure it's just a missing dependency though there's a timing issue when you create a bucket policy and public access policy close together in the AWS API, so we might also need to introduce a delay. Whatever the issue, it is definitely not important right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants