external-dns
external-dns copied to clipboard
Attaching Route53 Alias record to the existing ALB via Service or Istio VirtualService annotation.
What would you like to be added: We have use cases when on a new service deploy, the Route53 A record needs to be added to the existing ALB's Alias record. The order of operation is this:
- lookup the ALB to which attach the record by a known tag
- create A record pointing to the HOST name of the ALB looked up above
Here is the terraform that does this
data "aws_route53_zone" "env_zone" {
name = "dev.test.io."
private_zone = false
}
data "aws_lb" "external_ingress_alb" {
tags = var.ingress_alb_tag
}
resource "aws_route53_record" "eks_service_record" {
zone_id = data.aws_route53_zone.env_zone.zone_id
name = "test-service.dev.test.io"
type = "A"
alias {
name = data.aws_lb.external_ingress_alb.dns_name
zone_id = data.aws_lb.external_ingress_alb.zone_id
evaluate_target_health = false
}
}
Istio Gateway/Virtual service SNI routing forwards to the correct VirtualService?service via the ALB/Ingress as long as the A record for the same hostname attached to the ALB.
Why is this needed: Simplifies the deploy process and allows our pipeline to remove the terraform step above.