File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ module "static_site_hosting" {
96
96
| [ aws_s3_bucket_acl.logs] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl ) | resource |
97
97
| [ aws_s3_bucket_acl.static_site] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl ) | resource |
98
98
| [ aws_s3_bucket_logging.static_site] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_logging ) | resource |
99
+ | [ aws_s3_bucket_ownership_controls.logs] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls ) | resource |
100
+ | [ aws_s3_bucket_ownership_controls.static_site] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls ) | resource |
99
101
| [ aws_s3_bucket_policy.logs] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy ) | resource |
100
102
| [ aws_s3_bucket_policy.static_site] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy ) | resource |
101
103
| [ aws_s3_bucket_public_access_block.logs] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block ) | resource |
Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ resource "aws_s3_bucket_versioning" "logs" {
16
16
}
17
17
}
18
18
19
+ resource "aws_s3_bucket_ownership_controls" "logs" {
20
+ count = local. create_logs_bucket ? 1 : 0
21
+
22
+ bucket = aws_s3_bucket. logs [0 ]. id
23
+
24
+ rule {
25
+ object_ownership = " BucketOwnerPreferred"
26
+ }
27
+ }
28
+
19
29
resource "aws_s3_bucket_acl" "logs" {
20
30
count = local. enable_s3_access_logs ? 1 : 0
21
31
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ resource "aws_s3_bucket_logging" "static_site" {
18
18
target_prefix = " s3/static_site/"
19
19
}
20
20
21
+ resource "aws_s3_bucket_ownership_controls" "static_site" {
22
+ bucket = aws_s3_bucket. static_site . id
23
+
24
+ rule {
25
+ object_ownership = " BucketOwnerPreferred"
26
+ }
27
+ }
28
+
21
29
resource "aws_s3_bucket_acl" "static_site" {
22
30
bucket = aws_s3_bucket. static_site . id
23
31
acl = local. static_site_s3_acl
You can’t perform that action at this time.
0 commit comments