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

Changes To S3 Bucket Default Settings Breaks Access Logging #267

Open
daniel-nagy opened this issue Apr 26, 2023 · 3 comments
Open

Changes To S3 Bucket Default Settings Breaks Access Logging #267

daniel-nagy opened this issue Apr 26, 2023 · 3 comments
Labels
bug 🐛 An issue with the system

Comments

@daniel-nagy
Copy link

Describe the Bug

AWS made changes to the default settings for S3 buckets which is causing the creation of the S3 bucket for access logs to fail with the following error

Error creating S3 bucket: InvalidBucketAclWithObjectOwnership: Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting

See this issue for more information hashicorp/terraform-provider-aws#28353.

Expected Behavior

When access logging is enabled terraform plan succeeds.

Steps to Reproduce

Set cloudfront_access_logging_enabled to true.

Screenshots

No response

Environment

Github Actions Ubuntu latest

Terraform 1.1.9
Module version ~> 0.82.4

Additional Context

No response

@daniel-nagy daniel-nagy added the bug 🐛 An issue with the system label Apr 26, 2023
@davidjeddy
Copy link

With the change to the default security settings of AWS S3 buckets it would seem this modules implementation for bucket access logging needs some work. As a work-around disable bucket access logging in this module. If needed, implement via a different solution.

cloudfront_access_logging_enabled = false # InvalidBucketAclWithObjectOwnership: Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting

Hope this is helpful.

@josep-pla-jt
Copy link

Same with the origin bucket, default "Bucket owner enforced" configuration makes all module policies to fail when trying to be applied

soya-miyoshi added a commit to soya-miyoshi/terraform-aws-cloudfront-s3-cdn that referenced this issue Jun 12, 2023
soya-miyoshi added a commit to soya-miyoshi/terraform-aws-cloudfront-s3-cdn that referenced this issue Jun 12, 2023
@soya-miyoshi
Copy link

Updating the s3-log-storage module should fix this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

4 participants