-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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]: updating s3_object with aws provider 4.67.0 fails with putting S3 object ACL: AccessControlListNotSupported: The bucket does not allow ACLs
#31764
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Hi, The Terraform code is not formatted so I'm having difficulty reading it but as far as I can see you have object_ownership = "BucketOwnerEnforced" and according to https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html this does not allow ACLs. On the s3_object resource prior to 5.0.0 the acl argument defaulted to a value of private. See #27197 and compare the docs at https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object#acl (5.1.0) and https://registry.terraform.io/providers/hashicorp/aws/4.67.0/docs/resources/s3_bucket_object#acl (4.67.0) I think the solution to your problem is to set acl = null on the aws_s3_object resource for a short term fix or for a long term fix upgrade to 5.1.0+. Hope that helps, |
My short term fix was pinning the aws provider to 4.62.0 instead of using 4.67.0 which broke the existing code. And when using AWS provider 5.10.0, the following errors occurs - which I believe is covered by #31633
|
I have seen the error in #31633 but not consistently. Some projects apply fine the first time and other require a second apply. Not ideal but a double apply does work if required. |
Same here. But interestingly at next run there was nothing to update. |
Running |
Terraform Core Version
1.4.6
AWS Provider Version
4.67.0,
Affected Resource(s)
fails with Error: putting S3 object ACL: AccessControlListNotSupported: The bucket does not allow ACLs
The aws_s3_object resource and aws_s3_bucket
Expected Behavior
The object is updated/created in the s3 bucket
Actual Behavior
The apply fails
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
with aws provider 4.67.0
and a bucket with object_ownership = "BucketOwnerEnforced"
terraform apply
Debug Output
No response
Panic Output
No response
Important Factoids
It works when downgrading the aws provider version to 4.62.0
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: