From 487a6e489321c9cf732a42fc2c23ec942fafbe1e Mon Sep 17 00:00:00 2001 From: Carlos Lopes Date: Fri, 26 Jul 2024 12:51:42 -0300 Subject: [PATCH] fix: null value reference when copy_action is specified without lifecycle 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 --- examples/complete/outputs.tf | 9 ++++++--- main.tf | 2 +- variables.tf | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index e89031f..2ed3894 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -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" { diff --git a/main.tf b/main.tf index c7e8afc..32af4ac 100644 --- a/main.tf +++ b/main.tf @@ -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 diff --git a/variables.tf b/variables.tf index ed4e09c..e3ba782 100644 --- a/variables.tf +++ b/variables.tf @@ -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" { @@ -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 -} \ No newline at end of file +}