aws-samples / aws-codepipeline-terraform-cicd-samples

MIT No Attribution
96 stars 101 forks source link

Terraform Error: The bucket does not allow ACLs #12

Open emnedre opened 11 months ago

emnedre commented 11 months ago

Getting the following error when setting up the project:

│ Error: creating S3 bucket ACL for tf-validate-project-rpl20230723095148611900000001: AccessControlListNotSupported: The bucket does not allow ACLs │ status code: 400, request id: V6MDTSSF5QK5H1JT, host id: KME82KNLmvnEfdMNOsbUfC8+bf1F6KiSYfcppi3NnFOZgVwOjdd0qwoHh+Dfsv+sE7xDNIiten8= │ │ with module.s3_artifacts_bucket.aws_s3_bucket_acl.replication_bucket_acl, │ on modules/s3/main.tf line 120, in resource "aws_s3_bucket_acl" "replication_bucket_acl": │ 120: resource "aws_s3_bucket_acl" "replication_bucket_acl" { │ ╵ ╷ │ Error: creating S3 bucket ACL for tf-validate-project20230723100746984200000001: AccessControlListNotSupported: The bucket does not allow ACLs │ status code: 400, request id: ABM8EN00AAZVR2W3, host id: loDvDdpHBCpKuVnLCzztPyQcLiH453qit9bh9rdyZdetBRoY08oFXOlDZmZuNc8Wl9oAo35QbnU= │ │ with module.s3_artifacts_bucket.aws_s3_bucket_acl.codepipeline_bucket_acl, │ on modules/s3/main.tf line 199, in resource "aws_s3_bucket_acl" "codepipeline_bucket_acl": │ 199: resource "aws_s3_bucket_acl" "codepipeline_bucket_acl" { │ ╵

Which alignes well with this following issue: https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/issues/223

As s3 buckets would have ACLs disabled by default from April (Announced in december): https://aws.amazon.com/about-aws/whats-new/2022/12/amazon-s3-automatically-enable-block-public-access-disable-access-control-lists-buckets-april-2023/

labeveryday commented 4 months ago

+1 - will do a PR to have this removed.