-
Notifications
You must be signed in to change notification settings - Fork 0
/
lifecycle.tf
48 lines (35 loc) · 1008 Bytes
/
lifecycle.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
resource "aws_s3_bucket_lifecycle_configuration" "bucket_lifecycle" {
count = var.create ? 1 : 0
bucket = aws_s3_bucket.bucket[0].id
rule {
id = "Transition to Standard-IA"
transition {
storage_class = "STANDARD_IA"
days = var.infrequent_access_days
}
status = var.infrequent_access_enabled ? "Enabled" : "Disabled"
}
rule {
id = "Transition to Glacier Instant Retrieval"
transition {
storage_class = "GLACIER_IR"
days = var.glacier_days
}
status = var.glacier_enabled ? "Enabled" : "Disabled"
}
rule {
id = "Transition to Intelligent Tiering"
transition {
storage_class = "INTELLIGENT_TIERING"
days = var.intelligent_tiering_days
}
status = var.intelligent_tiering_enabled ? "Enabled" : "Disabled"
}
rule {
id = "Expires"
expiration {
days = var.expiration_objects_days
}
status = var.expiration_objects_enabled ? "Enabled" : "Disabled"
}
}