Skip to content

Commit

Permalink
Merge pull request #161 from uktrade/feat/enable-intelligent-tier-on-…
Browse files Browse the repository at this point in the history
…mirror-bucket

Enable intelligent tiering on mirror bucket for objects > 128KB
  • Loading branch information
peter-woodcock authored Nov 22, 2024
2 parents 4bb25b3 + 7827b71 commit 5cb9fbe
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions infra/s3_mirrors.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,21 @@ data "aws_iam_policy_document" "mirrors" {
}
}
}

resource "aws_s3_bucket_lifecycle_configuration" "intelligent_tier" {
count = var.mirrors_bucket_name != "" ? 1 : 0

bucket = aws_s3_bucket.mirrors.*.id[count.index]

rule {
id = "Move objects >128KB to Intelligent Tier"
# Objects smaller than 128 KB will not transition by default to any storage class

status = "Enabled"

transition {
days = 0
storage_class = "INTELLIGENT_TIERING"
}
}
}

0 comments on commit 5cb9fbe

Please sign in to comment.