Skip to content

Commit

Permalink
milliHQ#384: Fix ACL deployment failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
bensewell committed Nov 23, 2023
1 parent f6fc507 commit 4e8b4cc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/statics-deploy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ resource "aws_s3_bucket" "static_upload" {
tags = merge(var.tags, var.tags_s3_bucket)
}

resource "aws_s3_bucket_ownership_controls" "static_upload" {
bucket = aws_s3_bucket.static_upload.id
rule {
object_ownership = "BucketOwnerPreferred"

}
}

resource "aws_s3_bucket_acl" "static_upload" {
depends_on = [aws_s3_bucket_ownership_controls.static_upload]
bucket = aws_s3_bucket.static_upload.id
acl = "private"
}
Expand All @@ -39,7 +48,15 @@ resource "aws_s3_bucket" "static_deploy" {
tags = merge(var.tags, var.tags_s3_bucket)
}

resource "aws_s3_bucket_ownership_controls" "static_deploy" {
bucket = aws_s3_bucket.static_deploy.id
rule {
object_ownership = "BucketOwnerPreferred"
}
}

resource "aws_s3_bucket_acl" "static_deploy" {
depends_on = [aws_s3_bucket_ownership_controls.static_deploy]
bucket = aws_s3_bucket.static_deploy.id
acl = "private"
}
Expand Down

0 comments on commit 4e8b4cc

Please sign in to comment.