amazon-web-servicesamazon-s3terraformterraform-provider-awsacl

Create per-object ACL in AWS with Terraform


I am attempting to create a per-object ACL using Terraform in AWS.

Terrform lets me create a per-bucket ACL (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl), which I can also create in the Management Console. However, I don't appear to be able to create a ACL for a single file/object in S3 using Terraform. I'm able to do this with the Management Console, so I should be able to do it with Terraform, but I cannot find any examples/APIs that would allow this.

How do I set an ACL on a single file/object in S3 with Terraform?


Solution

  • The aws_s3_object itself has an acl argument: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_object#acl .