From 1ac353e5b91a338d245d59162ee73601985c3fef Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 24 Feb 2026 13:10:28 -0500 Subject: [PATCH] fix(main.tf) create association in region cluster is not in --- README.md | 2 ++ main.tf | 36 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ee88629..00c84f3 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ No modules. | [aws_route53_zone.cluster_domain](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource | | [aws_route53_zone_association.central_zone_east](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone_association) | resource | | [aws_route53_zone_association.central_zone_west](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone_association) | resource | +| [aws_route53_zone_association.cluster_zone_east](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone_association) | resource | +| [aws_route53_zone_association.cluster_zone_west](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone_association) | resource | | [aws_route53_zone_association.legacy_zone_east](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone_association) | resource | | [aws_route53_zone_association.legacy_zone_west](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone_association) | resource | | [null_resource.git_version](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | diff --git a/main.tf b/main.tf index 996a30b..7f4ee1a 100644 --- a/main.tf +++ b/main.tf @@ -45,7 +45,7 @@ resource "aws_route53_zone" "cluster_domain" { # east region #--- resource "aws_route53_vpc_association_authorization" "cluster_zone_east" { - count = local.region == var.region_map["east"] ? 1 : 0 + count = local.region != var.region_map["east"] ? 1 : 0 provider = aws.route53_self vpc_id = local.vpc_id @@ -53,22 +53,22 @@ resource "aws_route53_vpc_association_authorization" "cluster_zone_east" { zone_id = aws_route53_zone.cluster_domain.zone_id } -# resource "aws_route53_zone_association" "cluster_zone_east" { -# count = local.region == var.region_map["east"] ? 1 : 0 +resource "aws_route53_zone_association" "cluster_zone_east" { + count = local.region != var.region_map["east"] ? 1 : 0 -# provider = aws.route53_main -# vpc_id = local.vpc_id -# vpc_region = var.region_map["east"] -# zone_id = aws_route53_zone.cluster_domain.zone_id + provider = aws.route53_main + vpc_id = local.vpc_id + vpc_region = var.region_map["east"] + zone_id = aws_route53_zone.cluster_domain.zone_id -# depends_on = [aws_route53_vpc_association_authorization.cluster_zone_east] -# } + depends_on = [aws_route53_vpc_association_authorization.cluster_zone_east] +} #------------------------------------------------- # cluster PHZ Association west region #------------------------------------------------- resource "aws_route53_vpc_association_authorization" "cluster_zone_west" { - count = local.region == var.region_map["west"] ? 1 : 0 + count = local.region != var.region_map["west"] ? 1 : 0 provider = aws.route53_self vpc_id = local.vpc_id @@ -76,15 +76,15 @@ resource "aws_route53_vpc_association_authorization" "cluster_zone_west" { zone_id = aws_route53_zone.cluster_domain.zone_id } -# resource "aws_route53_zone_association" "cluster_zone_west" { -# count = local.region == var.region_map["west"] ? 1 : 0 -# provider = aws.route53_main -# vpc_id = local.vpc_id -# vpc_region = var.region_map["west"] -# zone_id = aws_route53_zone.cluster_domain.zone_id +resource "aws_route53_zone_association" "cluster_zone_west" { + count = local.region != var.region_map["west"] ? 1 : 0 + provider = aws.route53_main + vpc_id = local.vpc_id + vpc_region = var.region_map["west"] + zone_id = aws_route53_zone.cluster_domain.zone_id -# depends_on = [aws_route53_vpc_association_authorization.cluster_zone_west] -# } + depends_on = [aws_route53_vpc_association_authorization.cluster_zone_west] +} #--- # cluster domain associations with central networking account