11resource "aws_s3_bucket" "scpca_portal_bucket" {
22 bucket = " scpca-portal-${ var . user } -${ var . stage } "
3- # TODO: remove this when upgrading aws_provider version
4- acl = " private"
53 force_destroy = var. stage == " prod" ? false : true
64
75 tags = merge (
@@ -13,21 +11,19 @@ resource "aws_s3_bucket" "scpca_portal_bucket" {
1311 )
1412}
1513
16- # TODO: enable after upgrade
17- # resource "aws_s3_bucket_ownership_controls" "scpca_portal_bucket" {
18- # bucket = aws_s3_bucket.scpca_portal_bucket.id
19- # rule {
20- # object_ownership = "BucketOwnerPreferred"
21- # }
22- # }
14+ resource "aws_s3_bucket_ownership_controls" "scpca_portal_bucket" {
15+ bucket = aws_s3_bucket. scpca_portal_bucket . id
16+ rule {
17+ object_ownership = " BucketOwnerPreferred"
18+ }
19+ }
2320
24- # TODO: enable after upgrade
25- # resource "aws_s3_bucket_acl" "scpca_portal_bucket" {
26- # depends_on = [aws_s3_bucket_ownership_controls.scpca_portal_bucket]
27- #
28- # bucket = aws_s3_bucket.scpca_portal_bucket.id
29- # acl = "private"
30- # }
21+ resource "aws_s3_bucket_acl" "scpca_portal_bucket" {
22+ depends_on = [aws_s3_bucket_ownership_controls . scpca_portal_bucket ]
23+
24+ bucket = aws_s3_bucket. scpca_portal_bucket . id
25+ acl = " private"
26+ }
3127
3228resource "aws_s3_bucket_public_access_block" "scpca_portal_bucket" {
3329 bucket = aws_s3_bucket. scpca_portal_bucket . id
@@ -38,8 +34,6 @@ resource "aws_s3_bucket_public_access_block" "scpca_portal_bucket" {
3834
3935resource "aws_s3_bucket" "scpca_portal_cert_bucket" {
4036 bucket = " scpca-portal-cert-${ var . user } -${ var . stage } "
41- # TODO: remove this when upgrading aws_provider version
42- acl = " private"
4337 force_destroy = var. stage == " prod" ? false : true
4438
4539 # TODO: remove lifecycle rule when we upgrade aws_provider version
@@ -63,19 +57,18 @@ resource "aws_s3_bucket" "scpca_portal_cert_bucket" {
6357 )
6458}
6559
66- # TODO: enable after upgrade
67- # resource "aws_s3_bucket_ownership_controls" "scpca_portal_cert_bucket" {
68- # bucket = aws_s3_bucket.scpca_portal_cert_bucket.id
69- # rule {
70- # object_ownership = "BucketOwnerPreferred"
71- # }
72- # }
60+ resource "aws_s3_bucket_ownership_controls" "scpca_portal_cert_bucket" {
61+ bucket = aws_s3_bucket. scpca_portal_cert_bucket . id
62+ rule {
63+ object_ownership = " BucketOwnerPreferred"
64+ }
65+ }
7366
74- # resource "aws_s3_bucket_acl" "scpca_portal_cert_bucket" {
75- # depends_on = [aws_s3_bucket_ownership_controls.scpca_portal_cert_bucket]
76- # bucket = aws_s3_bucket.scpca_portal_cert_bucket.id
77- # acl = "private"
78- # }
67+ resource "aws_s3_bucket_acl" "scpca_portal_cert_bucket" {
68+ depends_on = [aws_s3_bucket_ownership_controls . scpca_portal_cert_bucket ]
69+ bucket = aws_s3_bucket. scpca_portal_cert_bucket . id
70+ acl = " private"
71+ }
7972
8073# resource "aws_s3_bucket_lifecycle_configuration" "scpca_portal_cert_bucket" {
8174# bucket = aws_s3_bucket.scpca_portal_cert_bucket.id
0 commit comments