Skip to content

Commit

Permalink
Merge pull request #1488 from ministryofjustice/MLPAB-2499-apply-to-r…
Browse files Browse the repository at this point in the history
…emaining-buckets

MLPAB-2499 apply to remaining buckets
  • Loading branch information
andrewpearce-digital authored Sep 13, 2024
2 parents f9aec61 + 0f04e06 commit 2609877
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
15 changes: 12 additions & 3 deletions terraform/account/region/modules/antivirus_definitions/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,22 @@ resource "aws_s3_bucket_lifecycle_configuration" "bucket" {
bucket = aws_s3_bucket.bucket.id

rule {
id = "abort-incomplete-multipart-upload"

id = "retain-for-30-days"
status = "Enabled"
expiration {
days = 30
}
noncurrent_version_expiration {
noncurrent_days = 30
}
}
rule {
id = "abort-incomplete-multipart-upload"
status = "Enabled"
abort_incomplete_multipart_upload {
days_after_initiation = 7
}

status = "Enabled"
}
provider = aws.region
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ resource "aws_s3_bucket_lifecycle_configuration" "lifecycle" {
expiration {
days = 30
}
}
rule {
id = "abort-incomplete-multipart-upload"
status = "Enabled"
abort_incomplete_multipart_upload {
days_after_initiation = 7
}

}
}
Expand Down
15 changes: 12 additions & 3 deletions terraform/account/region/modules/s3_batch_manifests/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,22 @@ resource "aws_s3_bucket_lifecycle_configuration" "bucket" {
bucket = aws_s3_bucket.bucket.id

rule {
id = "abort-incomplete-multipart-upload"

id = "retain-for-400-days"
status = "Enabled"
expiration {
days = 400
}
noncurrent_version_expiration {
noncurrent_days = 400
}
}
rule {
id = "abort-incomplete-multipart-upload"
status = "Enabled"
abort_incomplete_multipart_upload {
days_after_initiation = 7
}

status = "Enabled"
}
provider = aws.region
}
Expand Down
24 changes: 24 additions & 0 deletions terraform/account/region/s3_lb_access_logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ data "aws_elb_service_account" "main" {
region = data.aws_region.current.name
}

resource "aws_s3_bucket_lifecycle_configuration" "lifecycle" {
provider = aws.region
bucket = aws_s3_bucket.access_log.id

rule {
id = "retain-for-400-days"
status = "Enabled"
expiration {
days = 400
}
noncurrent_version_expiration {
noncurrent_days = 400
}
}
rule {
id = "abort-incomplete-multipart-upload"
status = "Enabled"
abort_incomplete_multipart_upload {
days_after_initiation = 7
}

}
}

data "aws_iam_policy_document" "access_log" {
provider = aws.region

Expand Down

0 comments on commit 2609877

Please sign in to comment.