Skip to content

Commit

Permalink
fix: null value reference when copy_action is specified without lifec…
Browse files Browse the repository at this point in the history
…ycle options (#86)

* fix: null value reference when copy_action is specified without lifecycle options

* chore: add descriptions to outputs from the example

* chore: add descriptions to input variables

---------

Co-authored-by: Carlos Lopes <[email protected]>
  • Loading branch information
carlosaml and carlosaml authored Jul 26, 2024
1 parent 903f650 commit 487a6e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
output "public_subnet_cidrs" {
value = module.subnets.public_subnet_cidrs
value = module.subnets.public_subnet_cidrs
description = "Public subnet CIDRs"
}

output "private_subnet_cidrs" {
value = module.subnets.private_subnet_cidrs
value = module.subnets.private_subnet_cidrs
description = "Private subnet CIDRs"
}

output "vpc_cidr" {
value = module.vpc.vpc_cidr_block
value = module.vpc.vpc_cidr_block
description = "VPC CIDR"
}

output "efs_arn" {
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ resource "aws_backup_plan" "default" {
destination_vault_arn = rule.value.copy_action.destination_vault_arn

dynamic "lifecycle" {
for_each = lookup(rule.value.copy_action, "lifecycle", null) != null != null ? [true] : []
for_each = lookup(rule.value.copy_action, "lifecycle", null) != null ? [true] : []

content {
cold_storage_after = rule.value.copy_action.lifecycle.cold_storage_after
Expand Down
5 changes: 3 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ variable "advanced_backup_setting" {
backup_options = string
resource_type = string
})
default = null
description = "An object that specifies backup options for each resource type"
default = null
}

variable "backup_resources" {
Expand Down Expand Up @@ -129,4 +130,4 @@ variable "backup_vault_lock_configuration" {
`changeable_for_days` - The number of days before the lock date. If omitted creates a vault lock in `governance` mode, otherwise it will create a vault lock in `compliance` mode.
EOT
default = null
}
}

0 comments on commit 487a6e4

Please sign in to comment.