Route53 SRV Records

Does anyone know the correct syntax (and ideally an example!) of the creation of a multi-server entry SRV record via a aws_route53_record resource?

For example there is no mention of support for the ‘port’ variable that is needed for an SRV record entry.

Thanks,

Solved it - here is the code in case it helps someone out:

resource “aws_route53_record” “_servers” {
zone_id = aws_route53_zone.myzone.zone_id
name = “_servers._tcp”
type = “SRV”
ttl = 60
records = [for dns_name in data.aws_instance.myservers.private_dns : “0 10 9100 ${dns_name}.”]
}

1 Like