File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ The module also simplifies a few boilerplate records at the apex for security pu
3333| [ aws_route53_zone.redirect_zone] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone ) | resource |
3434| [ aws_s3_bucket.redirect] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket ) | resource |
3535| [ aws_s3_bucket_acl.redirect] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl ) | resource |
36+ | [ aws_s3_bucket_ownership_controls.redirect] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls ) | resource |
3637| [ aws_s3_bucket_website_configuration.redirect] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration ) | resource |
3738
3839## Inputs
Original file line number Diff line number Diff line change @@ -3,10 +3,19 @@ resource "aws_s3_bucket" "redirect" {
33 bucket = each. key
44}
55
6- resource "aws_s3_bucket_acl " "redirect" {
6+ resource "aws_s3_bucket_ownership_controls " "redirect" {
77 for_each = toset (concat (var. aliases , [for a in var . aliases : " www.${ a } " ]))
88 bucket = aws_s3_bucket. redirect [each . key ]. bucket
9- acl = " private"
9+ rule {
10+ object_ownership = " ObjectWriter"
11+ }
12+ }
13+
14+ resource "aws_s3_bucket_acl" "redirect" {
15+ for_each = toset (concat (var. aliases , [for a in var . aliases : " www.${ a } " ]))
16+ depends_on = [aws_s3_bucket_ownership_controls . redirect ]
17+ bucket = aws_s3_bucket. redirect [each . key ]. bucket
18+ acl = " private"
1019}
1120
1221resource "aws_s3_bucket_website_configuration" "redirect" {
You can’t perform that action at this time.
0 commit comments