File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1
1
resource "aws_s3_bucket" "log" {
2
- bucket = " ${ var . name_prefix } -log"
3
2
acl = " log-delivery-write"
3
+ bucket = " ${ var . name_prefix } -log"
4
4
lifecycle {
5
5
prevent_destroy = true
6
6
}
7
7
lifecycle_rule {
8
8
id = " log"
9
- prefix = " /"
10
9
enabled = true
11
10
12
11
transition {
13
- days = 30
12
+ days = " ${ var . transition_to_glacier } "
14
13
storage_class = " GLACIER"
15
14
}
16
15
17
16
expiration {
18
- days = 2555
17
+ days = " ${ var . expiration } "
18
+ }
19
+ }
20
+ server_side_encryption_configuration {
21
+ rule {
22
+ apply_server_side_encryption_by_default {
23
+ sse_algorithm = " AES256"
24
+ }
19
25
}
20
26
}
21
27
}
Original file line number Diff line number Diff line change
1
+ variable "expiration" {
2
+ default = 2555
3
+ description = " The number of days to wait before expiring an object"
4
+ type = " string"
5
+ }
6
+
1
7
variable "name_prefix" {
2
8
description = " The name prefix to use when creating resource names"
3
9
type = " string"
10
+ }
11
+
12
+ variable "transition_to_glacier" {
13
+ default = 30
14
+ description = " The number of days to wait before transitioning an object to Glacier"
15
+ type = " string"
4
16
}
You can’t perform that action at this time.
0 commit comments