diff --git a/modules/dns/route53/tectonic.tf b/modules/dns/route53/tectonic.tf index 3879a3e9a1..ef7055976f 100644 --- a/modules/dns/route53/tectonic.tf +++ b/modules/dns/route53/tectonic.tf @@ -3,30 +3,13 @@ data "aws_route53_zone" "tectonic" { } locals { - private_zone_id = "${var.tectonic_external_private_zone == "" ? - join("", aws_route53_zone.tectonic_int.*.zone_id) : - var.tectonic_external_private_zone}" - public_zone_id = "${join("", data.aws_route53_zone.tectonic.*.zone_id)}" - zone_id = "${var.tectonic_private_endpoints ? - local.private_zone_id : + zone_id = "${var.private_endpoints ? + var.private_zone_id : local.public_zone_id}" } -resource "aws_route53_zone" "tectonic_int" { - count = "0" - vpc_id = "${var.tectonic_external_vpc_id}" - name = "${var.base_domain}" - force_destroy = true - - tags = "${merge(map( - "Name", "${var.cluster_name}_tectonic_int_zone", - "KubernetesCluster", "${var.cluster_name}", - "tectonicClusterID", "${var.cluster_id}" - ), var.tectonic_extra_tags)}" -} - resource "aws_route53_record" "tectonic_api" { count = "${var.elb_alias_enabled ? 0 : 1}" zone_id = "${local.public_zone_id}" @@ -37,7 +20,7 @@ resource "aws_route53_record" "tectonic_api" { } resource "aws_route53_record" "tectonic_api_external" { - count = "${var.elb_alias_enabled ? var.tectonic_public_endpoints : 0}" + count = "${var.elb_alias_enabled ? var.public_endpoints : 0}" zone_id = "${local.public_zone_id}" name = "${var.cluster_name}-api.${var.base_domain}" type = "A" @@ -50,8 +33,8 @@ resource "aws_route53_record" "tectonic_api_external" { } resource "aws_route53_record" "tectonic_api_internal" { - count = "${var.elb_alias_enabled ? var.tectonic_private_endpoints : 0}" - zone_id = "${local.private_zone_id}" + count = "${var.elb_alias_enabled ? var.private_endpoints : 0}" + zone_id = "${var.private_zone_id}" name = "${var.cluster_name}-api.${var.base_domain}" type = "A" @@ -72,7 +55,7 @@ resource "aws_route53_record" "tectonic-console" { } resource "aws_route53_record" "tectonic_ingress_public" { - count = "${var.elb_alias_enabled ? var.tectonic_public_endpoints : 0}" + count = "${var.elb_alias_enabled ? var.public_endpoints : 0}" zone_id = "${local.public_zone_id}" name = "${var.cluster_name}.${var.base_domain}" type = "A" @@ -85,8 +68,8 @@ resource "aws_route53_record" "tectonic_ingress_public" { } resource "aws_route53_record" "tectonic_ingress_private" { - count = "${var.elb_alias_enabled ? var.tectonic_private_endpoints : 0}" - zone_id = "${local.private_zone_id}" + count = "${var.elb_alias_enabled ? var.private_endpoints : 0}" + zone_id = "${var.private_zone_id}" name = "${var.cluster_name}.${var.base_domain}" type = "A" diff --git a/modules/dns/route53/variables.tf b/modules/dns/route53/variables.tf index 6b23b08be4..f8798eff9b 100644 --- a/modules/dns/route53/variables.tf +++ b/modules/dns/route53/variables.tf @@ -53,7 +53,7 @@ variable "api_ip_addresses" { type = "list" } -variable "tectonic_extra_tags" { +variable "extra_tags" { type = "map" description = "(optional) Extra tags to be applied to created resources." } @@ -70,7 +70,7 @@ EOF default = false } -variable "tectonic_external_vpc_id" { +variable "external_vpc_id" { type = "string" description = <