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

Error: error creating S3 bucket ACL for bucket-name: AccessControlListNotSupported: The bucket does not allow ACLs #17

Closed
mattiasnixell opened this issue Apr 24, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mattiasnixell
Copy link
Contributor

Bug report

New "terraform state" deployments fail on "aws_s3_bucket_acl". I am 95% sure this is related to the new S3 defaults in AWS this month. Here are suggested changes for Terraform: hashicorp/terraform-provider-aws#28353

They suggest removing "aws_s3_bucket_acl" as the new ACL default is private or adding "aws_s3_bucket_ownership_controls" that must be set to "BucketOwnerPreferred" before private ACL may be applied.

Steps to reproduce

Apply a fresh terraform init module:

module "terraform-init" {
  source  = "telia-oss/terraform-init/aws"
  version = "4.0.2"
  name_prefix = "<unique name here>"
}

Terraform version

$ terraform version

Terraform v1.4.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v4.64.0
@mattiasnixell mattiasnixell added the bug Something isn't working label Apr 24, 2023
@mattiasnixell
Copy link
Contributor Author

I cloned the repo locally and added "aws_s3_bucket_ownership_controls" as suggested in the terraform issue. However, that does not work... I added a comment about this in the mentioned issue: hashicorp/terraform-provider-aws#28353 (comment)

Removing the "aws_s3_bucket_acl" seems to work better for new S3 buckets. However, that might break old terraform states (?). AWS mentions the old buckets are not affected by new defaults. So, I'm hopeful they can fix this issue in the terraform provider.

@mattiasnixell
Copy link
Contributor Author

Ignore my previous comment! I made a copy-paste error and now it works. I'll open a pull request with the suggested change soon.

@rickardl
Copy link
Contributor

This is resolved in 4.X.0

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

No branches or pull requests

2 participants