From b697a2b0ca5688266ac81d373f790d3173aabaa4 Mon Sep 17 00:00:00 2001 From: xpk Date: Tue, 30 Apr 2024 10:03:48 +0800 Subject: [PATCH] UPD: refactored resource_type_opt_in_preference with a for loop --- modules/storage/aws-backup/main.tf | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/modules/storage/aws-backup/main.tf b/modules/storage/aws-backup/main.tf index 51e72c1..3bf5cd1 100644 --- a/modules/storage/aws-backup/main.tf +++ b/modules/storage/aws-backup/main.tf @@ -52,18 +52,7 @@ locals { resource "aws_backup_region_settings" "ab-settings" { resource_type_opt_in_preference = { - "Aurora" = local.backup-config.Aurora.enabled - "DynamoDB" = local.backup-config.DynamoDB.enabled - "EBS" = local.backup-config.EBS.enabled - "EC2" = local.backup-config.EC2.enabled - "EFS" = local.backup-config.EFS.enabled - "FSx" = local.backup-config.FSx.enabled - "Redshift" = local.backup-config.Redshift.enabled - "RDS" = local.backup-config.RDS.enabled - # "Storage Gateway" = lookup(local.backup-config, "Storage Gateway").enabled - "VirtualMachine" = local.backup-config.VirtualMachine.enabled - "S3" = local.backup-config.S3.enabled - # not available in all regions "DocumentDB" = false + for k, v in local.backup-config : k => v.enabled } }