Skip to content

Commit

Permalink
Fix ACL on remote state bucket create
Browse files Browse the repository at this point in the history
  • Loading branch information
kramerc committed May 26, 2024
1 parent eb573a3 commit eaabde9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions remote-state/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions remote-state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ resource "aws_s3_bucket" "terraform_state" {
}
}

resource "aws_s3_bucket_ownership_controls" "s3_bucket_acl_ownership" {
bucket = aws_s3_bucket.terraform_state.id

rule {
object_ownership = "ObjectWriter"
}
}

resource "aws_s3_bucket_acl" "terraform_state" {
depends_on = [aws_s3_bucket_ownership_controls.s3_bucket_acl_ownership]

bucket = aws_s3_bucket.terraform_state.id
acl = "private"
}
Expand Down

0 comments on commit eaabde9

Please sign in to comment.