to apply the policy for the bucket I had this error:
Error: Error putting S3 policy: AccessDenied: Access Denied
I fixed it by adding my AWS User ARN (can be copied after clicking on security credentials in aws console) in the principal of the policy as:
resource "aws_s3_bucket_policy" "public_read" {
bucket = aws_s3_bucket.data.id
to apply the policy for the bucket I had this error: Error: Error putting S3 policy: AccessDenied: Access Denied I fixed it by adding my AWS User ARN (can be copied after clicking on security credentials in aws console) in the principal of the policy as: resource "aws_s3_bucket_policy" "public_read" { bucket = aws_s3_bucket.data.id
policy = jsonencode({ "Statement" = [ {
}) }