From 3a448515a686184cae89317936e08ddc904a5bc6 Mon Sep 17 00:00:00 2001 From: badra001 Date: Wed, 28 Jun 2023 06:37:03 -0400 Subject: [PATCH] - route53-zone-association - fix zone_ids to remove null --- CHANGELOG.md | 4 ++++ common/version.tf | 2 +- examples/full-setup-tf-upgrade/tf-run.destroy.data | 4 +++- route53-zone-association/vpc/main.tf | 5 +++-- route53-zone-association/zone/main.tf | 7 ++++--- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c55460f..5963329 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -321,3 +321,7 @@ - vpn-transit-gateway - add ok_action, update template, add version to description - add composite alarms for whole site and all tunnels + +* 2.9.2 -- 2023-06-28 + - route53-zone-association + - fix zone_ids to remove null diff --git a/common/version.tf b/common/version.tf index 344acf7..91c73cc 100644 --- a/common/version.tf +++ b/common/version.tf @@ -1,5 +1,5 @@ locals { - _module_version = "2.9.1" + _module_version = "2.9.2" _module_names = { "_main_" = "aws-vpc-setup" diff --git a/examples/full-setup-tf-upgrade/tf-run.destroy.data b/examples/full-setup-tf-upgrade/tf-run.destroy.data index 1e8f952..02dbafe 100644 --- a/examples/full-setup-tf-upgrade/tf-run.destroy.data +++ b/examples/full-setup-tf-upgrade/tf-run.destroy.data @@ -1,4 +1,4 @@ -VERSION 1.0.5 +VERSION 1.0.7 BACKUP-STATE COMMAND tf-init COMMAND tf-state list @@ -14,6 +14,8 @@ module.base-security-groups module.flowlogs module.vpn module.routing +module.vpce module.routing_attachment module.subnets module.vpc +# mv vpc-transit-gateway.tf vpc-transit-gateway.tf.off ALL diff --git a/route53-zone-association/vpc/main.tf b/route53-zone-association/vpc/main.tf index 75046bd..ba1a475 100644 --- a/route53-zone-association/vpc/main.tf +++ b/route53-zone-association/vpc/main.tf @@ -15,6 +15,7 @@ locals { "boc:tf_module_name" = lookup(local._module_names, local._module_name, local._module_names["_main_"]) "boc:created_by" = "terraform" } + zone_ids = compact(var.zone_ids) } #--- @@ -22,7 +23,7 @@ locals { #--- resource "aws_route53_vpc_association_authorization" "peer_zone" { provider = aws.peer - for_each = data.aws_caller_identity.self.account_id != data.aws_caller_identity.peer.account_id ? toset(var.zone_ids) : toset([]) + for_each = data.aws_caller_identity.self.account_id != data.aws_caller_identity.peer.account_id ? toset(local.zone_ids) : toset([]) zone_id = each.key vpc_region = var.region == null ? data.aws_region.self.name : var.region vpc_id = var.vpc_id @@ -30,7 +31,7 @@ resource "aws_route53_vpc_association_authorization" "peer_zone" { resource "aws_route53_zone_association" "peer_zone" { provider = aws.self - for_each = toset(var.zone_ids) + for_each = toset(local.zone_ids) zone_id = each.key vpc_id = var.vpc_id diff --git a/route53-zone-association/zone/main.tf b/route53-zone-association/zone/main.tf index 8a194d0..596efa6 100644 --- a/route53-zone-association/zone/main.tf +++ b/route53-zone-association/zone/main.tf @@ -15,11 +15,12 @@ locals { "boc:tf_module_name" = lookup(local._module_names, local._module_name, local._module_names["_main_"]) "boc:created_by" = "terraform" } + zone_ids = compact(var.zone_ids) } resource "aws_route53_vpc_association_authorization" "self_zone" { provider = aws.self - for_each = data.aws_caller_identity.self.account_id != data.aws_caller_identity.peer.account_id ? toset(var.zone_ids) : toset([]) + for_each = data.aws_caller_identity.self.account_id != data.aws_caller_identity.peer.account_id ? toset(local.zone_ids) : toset([]) zone_id = each.key vpc_region = var.region == null ? data.aws_region.peer.name : var.region vpc_id = var.vpc_id @@ -27,7 +28,7 @@ resource "aws_route53_vpc_association_authorization" "self_zone" { resource "aws_route53_zone_association" "self_zone" { provider = aws.peer - for_each = toset(var.zone_ids) + for_each = toset(local.zone_ids) zone_id = each.key vpc_id = var.vpc_id @@ -41,7 +42,7 @@ resource "aws_route53_zone_association" "self_zone" { #--- data "aws_route53_zone" "zones" { provider = aws.self - for_each = toset(var.zone_ids) + for_each = toset(local.zone_ids) zone_id = each.key private_zone = var.private_zone }