Skip to content

Commit 4e10061

Browse files
committed
Merges origin/Allow-Lifecycle-Rules-For-Noncurrent-Objects (pull request #84)
2 parents 4a5ae68 + ff61464 commit 4e10061

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,15 @@ list(object({
13331333
date = optional(string)
13341334
storage_class = string
13351335
})), [])
1336+
noncurrent_version_expiration = optional(list(object({
1337+
noncurrent_days = optional(number)
1338+
newer_noncurrent_versions = optional(string)
1339+
})), [])
1340+
noncurrent_version_transition = optional(list(object({
1341+
noncurrent_days = optional(number)
1342+
newer_noncurrent_versions = optional(string)
1343+
storage_class = string
1344+
})), [])
13361345
}))
13371346
```
13381347

@@ -1787,6 +1796,15 @@ list(object({
17871796
date = optional(string)
17881797
storage_class = string
17891798
})), [])
1799+
noncurrent_version_expiration = optional(list(object({
1800+
noncurrent_days = optional(number)
1801+
newer_noncurrent_versions = optional(string)
1802+
})), [])
1803+
noncurrent_version_transition = optional(list(object({
1804+
noncurrent_days = optional(number)
1805+
newer_noncurrent_versions = optional(string)
1806+
storage_class = string
1807+
})), [])
17901808
}))
17911809
```
17921810

rds-s3-dumps.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,23 @@ resource "aws_s3_bucket_lifecycle_configuration" "rds_dumps" {
217217
storage_class = transition.value.storage_class
218218
}
219219
}
220+
221+
dynamic "noncurrent_version_expiration" {
222+
for_each = rule.value.noncurrent_version_expiration
223+
content {
224+
noncurrent_days = noncurrent_version_expiration.value.noncurrent_days
225+
newer_noncurrent_versions = noncurrent_version_expiration.value.newer_noncurrent_versions
226+
}
227+
}
228+
229+
dynamic "noncurrent_version_transition" {
230+
for_each = rule.value.noncurrent_version_transition
231+
content {
232+
noncurrent_days = noncurrent_version_transition.value.noncurrent_days
233+
newer_noncurrent_versions = noncurrent_version_transition.value.newer_noncurrent_versions
234+
storage_class = noncurrent_version_transition.value.storage_class
235+
}
236+
}
220237
}
221238
}
222239
}

s3.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ resource "aws_s3_bucket_lifecycle_configuration" "this" {
8383
storage_class = transition.value.storage_class
8484
}
8585
}
86+
87+
dynamic "noncurrent_version_expiration" {
88+
for_each = rule.value.noncurrent_version_expiration
89+
content {
90+
noncurrent_days = noncurrent_version_expiration.value.noncurrent_days
91+
newer_noncurrent_versions = noncurrent_version_expiration.value.newer_noncurrent_versions
92+
}
93+
}
94+
95+
dynamic "noncurrent_version_transition" {
96+
for_each = rule.value.noncurrent_version_transition
97+
content {
98+
noncurrent_days = noncurrent_version_transition.value.noncurrent_days
99+
newer_noncurrent_versions = noncurrent_version_transition.value.newer_noncurrent_versions
100+
storage_class = noncurrent_version_transition.value.storage_class
101+
}
102+
}
86103
}
87104
}
88105
}

variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,15 @@ variable "rds_s3_dump_lifecycle_rules" {
804804
date = optional(string)
805805
storage_class = string
806806
})), [])
807+
noncurrent_version_expiration = optional(list(object({
808+
noncurrent_days = optional(number)
809+
newer_noncurrent_versions = optional(string)
810+
})), [])
811+
noncurrent_version_transition = optional(list(object({
812+
noncurrent_days = optional(number)
813+
newer_noncurrent_versions = optional(string)
814+
storage_class = string
815+
})), [])
807816
}))
808817

809818
validation {
@@ -1196,6 +1205,15 @@ variable "s3_lifecycle_rules" {
11961205
date = optional(string)
11971206
storage_class = string
11981207
})), [])
1208+
noncurrent_version_expiration = optional(list(object({
1209+
noncurrent_days = optional(number)
1210+
newer_noncurrent_versions = optional(string)
1211+
})), [])
1212+
noncurrent_version_transition = optional(list(object({
1213+
noncurrent_days = optional(number)
1214+
newer_noncurrent_versions = optional(string)
1215+
storage_class = string
1216+
})), [])
11991217
}))
12001218

12011219
validation {

0 commit comments

Comments
 (0)