Skip to content

Commit

Permalink
Explicitly keep previous default for s3 transition lifecycle property
Browse files Browse the repository at this point in the history
AWS changed the default for this property from varies_by_storage_class to all_storage_classes_128K. For now we are setting this field explicitly so we keep the old behavior.

- The AWS provider has an issue describing this change here: hashicorp/terraform-provider-aws#41126
- AWS docs here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfiguration.html
- Slack thread discussing the change here: https://gsa-tts.slack.com/archives/C0ENP71UG/p1739218411084849
  • Loading branch information
jameshochadel committed Feb 10, 2025
1 parent af7ef36 commit 3549d7c
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions terraform/modules/external_domain_broker/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "cloudfront_log_bucket_lifecycl
days = 930
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}

resource "aws_s3_bucket_acl" "cloudfront_log_bucket_acl" {
Expand Down
1 change: 1 addition & 0 deletions terraform/modules/log_bucket/log_bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "log_bucket_lifecycle" {
days = 180
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}
resource "aws_s3_bucket_policy" "log_bucket_policy" {
bucket = aws_s3_bucket.log_bucket.id
Expand Down
1 change: 1 addition & 0 deletions terraform/modules/log_bucket_v2/log_bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "log_bucket_lifecycle" {
days = 180
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}
resource "aws_s3_bucket_policy" "log_bucket_policy" {
bucket = aws_s3_bucket.log_bucket.id
Expand Down
1 change: 1 addition & 0 deletions terraform/modules/logsearch/platform_log_bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "log_bucket_lifecycle" {
days = 930 # 31 days * 30 months = 930 days
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "encrypted_bucket_lifecycle" {
}
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}

resource "aws_s3_bucket_policy" "encrypted_bucket_policy" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "encrypted_bucket_lifecycle" {
}
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}

resource "aws_s3_bucket_policy" "encrypted_bucket_policy" {
Expand Down
1 change: 1 addition & 0 deletions terraform/modules/s3_bucket/kms_encrypted_bucket/bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ resource "aws_s3_bucket_lifecycle_configuration" "kms_encrypted_bucket_lifecycle
}
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "log_encrypted_bucket_lifecycle
}
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}

resource "aws_s3_bucket_logging" "log_encrypted_bucket_access_logging" {
Expand Down
2 changes: 2 additions & 0 deletions terraform/stacks/tooling/s3-logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "s3_audit_logs_trail_bucket_lif
days = 930 # ~30 months for M-21-31 compliance
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}

resource "aws_s3_bucket_logging" "cg-s3-cloudtrail-bucket-logging" {
Expand Down Expand Up @@ -134,4 +135,5 @@ resource "aws_s3_bucket_lifecycle_configuration" "s3_access_logs_trail_bucket_li
days = 930 # ~30 months for M-21-31 compliance
}
}
transition_default_minimum_object_size = "varies_by_storage_class"
}

0 comments on commit 3549d7c

Please sign in to comment.