Hi everyone.
When you use:
resource "aws_lightsail_domain" "example.name" {
domain_name = "example$.com"
}
where “example.name” represents the label and “example$.com” the domain, TF creates a DNS as expected in Lightsail.
The thing is that if the domain is a Route53 registered, there already exists a NS delegation set when you run “create-hosted-zone” or use:
resource "aws_route53_zone" "example" {
name = "test.example$.com"
}
resource "aws_route53_record" "example" {
allow_overwrite = true
name = "example$.com"
ttl = 30
type = "NS"
zone_id = aws_route53_zone.example.zone_id
records = [
aws_route53_zone.example.name_servers[0],
aws_route53_zone.example.name_servers[1],
aws_route53_zone.example.name_servers[2],
aws_route53_zone.example.name_servers[3],
]
}
How do one pass the one created with the resource:
"aws_route53_zone"
to Lightsail config so that it can use it instead of creating a new one?
Or is there any saner method to pass NS records to Lightsail to use?
Thanks for your help.