File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
modules/s3-archive-bucket Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ resource "aws_s3_bucket_versioning" "this" {
35
35
36
36
# TODO: `expected_bucket_owner`
37
37
resource "aws_s3_bucket_lifecycle_configuration" "this" {
38
+ count = length (var. lifecycle_rules ) > 0 ? 1 : 0
39
+
38
40
bucket = aws_s3_bucket. this . bucket
39
41
40
42
dynamic "rule" {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ output "versioning" {
50
50
output "lifecycle_rules" {
51
51
description = " The lifecycle configuration for the bucket."
52
52
value = {
53
- for rule in aws_s3_bucket_lifecycle_configuration . this . rule :
53
+ for rule in try ( aws_s3_bucket_lifecycle_configuration. this [ 0 ] . rule , []) :
54
54
rule.id = > {
55
55
id = rule.id
56
56
enabled = rule.status == " Enabled"
You can’t perform that action at this time.
0 commit comments