terraform-aws-eks-blueprints icon indicating copy to clipboard operation
terraform-aws-eks-blueprints copied to clipboard

[QUESTION] Multiple Route53 Zones with ExternalDNS

Open andrewmiskell opened this issue 2 years ago • 2 comments

Trying to see if it's possible to support external-dns adding records to multiple Route53 zones.

The documentation states that setting the eks_cluster_domain value is optional in order to set the zoneIdFilters, however, if I don't specify that value a get an error during apply stating.

│Error: Either name or zone_id must be set with module.eks_cluster_kubernetes_addons.module.external_dns[0].data.aws_route53_zone.selected, on .terraform/modules/eks_cluster_kubernetes_addons/modules/kubernetes-addons/external-dns/data.tf line 1, in data "aws_route53_zone" "selected": 1: data "aws_route53_zone" "selected" {

If I do set a value in eks_cluster_domain, the apply proceeds but then it sets a single zoneIdFilters with the zone id defined in eks_cluster_domain. I'd like to have the ability to either not have a zoneIdFilter (to allow it to create DNS records in any Route53 zone I have) or the ability to define multiple zoneIdFilters.

andrewmiskell avatar May 12 '22 16:05 andrewmiskell

@andrewmiskell thanks for creating this issue. Agree that this should be support. I'll go ahead and add this issue to the backlog.

kcoleman731 avatar May 12 '22 23:05 kcoleman731

I have successfully adjusted the knobs to support multiple zones using the following config:

  # External DNS
  enable_external_dns      = true
  external_dns_helm_config = {
    version    = "6.4.6"
    namespace  = "kube-system"
    domain_name = var.tld
    values     = [
<<EOF
provider: "aws"
aws:
  region: "${var.region}"
  zoneType: "public"
  apiRetries: 3
  batchChangeSize: 1000
  preferCNAME: false

logLevel: "info"
logFormat: "text"

interval: "1m"

policy: "upsert-only"
registry: "txt"
txtOwnerId: "external-dns"
sources:
  - "service"
  - "ingress"

domainFilters: ["${join("\" ,\"", concat([var.tld], var.alternate_tlds))}"]
EOF
    ]
  }

guilhermeblanco avatar May 27 '22 01:05 guilhermeblanco