Skip to content

Commit d086f88

Browse files
committed
[NRL-1158] Allow for unset copy_action in backup config
1 parent 9e6701c commit d086f88

File tree

1 file changed

+2
-2
lines changed
  • terraform/account-wide-infrastructure/modules/backup-source

1 file changed

+2
-2
lines changed

terraform/account-wide-infrastructure/modules/backup-source/backup_plan.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ resource "aws_backup_plan" "default" {
1717
cold_storage_after = rule.value.lifecycle.cold_storage_after
1818
}
1919
dynamic "copy_action" {
20-
for_each = rule.value.copy_action
20+
for_each = rule.value.copy_action != null ? rule.value.copy_action : []
2121
content {
2222
lifecycle {
2323
delete_after = copy_action.value.delete_after
@@ -48,7 +48,7 @@ resource "aws_backup_plan" "dynamodb" {
4848
cold_storage_after = rule.value.lifecycle.cold_storage_after
4949
}
5050
dynamic "copy_action" {
51-
for_each = rule.value.copy_action
51+
for_each = rule.value.copy_action != null ? rule.value.copy_action : []
5252
content {
5353
lifecycle {
5454
delete_after = copy_action.value.delete_after

0 commit comments

Comments
 (0)