cloudposse / terraform-aws-vpc-flow-logs-s3-bucket

Terraform module to provision s3-backed flow logs for VPC and subnets

Home Page:https://cloudposse.com/accelerate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New S3 default policy breaks creation of S3 bucket

victor-chan-groundswell opened this issue · comments

It would seem that Amazon is pushing S3 bucket defaults that's breaking the module.

https://aws.amazon.com/about-aws/whats-new/2023/04/amazon-s3-two-security-best-practices-buckets-default/

Unfortunately, this means that, with the combination of default settings, the s3 bucket doesn't create as it appears that the default policy that it sets in is incompatible with the bucket policy that is trying to put in.

image

I'm going to try to workaround this buy actually getting the module and tweaking the settings of the downstream s3 module to allow ACLs to see if it works.

Form what I have experimented so far...., changing a setting so that I can set s3_object_ownership to "BucketOwnerPreferred" has a okay workaround....

image

in that, in the 1st TF run, I still run into this, but if I ran TF apply again a 2nd time, then everything gets applied and set.

image

I think it might have something to deal with how the cloudposse/s3-log-storage/aws module sets up the ACL....

hashicorp/terraform-provider-aws#28353

Isn't the default for the s3_object_ownership input variable already BucketOwnerPreferred?

commented

This has been fixed in the upstream terraform-aws-s3-bucket and will be fixed in the next release of this module.