Skip to content

Commit 3ee1a0b

Browse files
committed
add s3 bucket lifecycle rule
1 parent 9983c44 commit 3ee1a0b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

terraform/modules/frontend/main.tf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@ resource "aws_s3_bucket" "frontend" {
22
bucket = "${var.BucketPrefix}-${var.ProjectId}"
33
}
44

5+
resource "aws_s3_bucket_lifecycle_configuration" "frontend" {
6+
bucket = aws_s3_bucket.frontend.id
7+
8+
rule {
9+
id = "AbortIncompleteMultipartUploads"
10+
status = "Enabled"
11+
12+
abort_incomplete_multipart_upload {
13+
days_after_initiation = 1
14+
}
15+
}
16+
17+
rule {
18+
id = "ObjectLifecycle"
19+
status = "Enabled"
20+
21+
filter {}
22+
23+
transition {
24+
days = 30
25+
storage_class = "INTELLIGENT_TIERING"
26+
}
27+
28+
noncurrent_version_transition {
29+
noncurrent_days = 30
30+
storage_class = "STANDARD_IA"
31+
}
32+
33+
noncurrent_version_expiration {
34+
noncurrent_days = 30
35+
}
36+
}
37+
}
38+
539
data "archive_file" "ui" {
640
type = "zip"
741
source_dir = "${path.module}/../../../dist_ui/"

0 commit comments

Comments
 (0)