Github Repo : https://github.com/dongkoony/BootGenie_AWS_Terraform
Hello, I am currently working on deploying AWS resources using Terraform. I am defining Route53 resources with Terraform and I am wondering if it is possible to manually specify AWS Route53 Name Servers, or if I have to use the automatically assigned Name Servers. I am using a domain purchased from a different provider. Below is a portion of my Route53 code.
resource "aws_route53_record" "ns" {
zone_id = aws_route53_zone.main.zone_id
name = local.domain_name
type = "NS"
ttl = 172800
records = [
"ns-816.awsdns-38.net.",
"ns-432.awsdns-54.com.",
"ns-1993.awsdns-57.co.uk.",
"ns-1298.awsdns-34.org."
]
}
When I apply this code using terraform apply, the specified Name Servers are not set, and arbitrary Name Servers are assigned instead. I was expecting the Name Servers I defined in the code to be used.
donghyeonshin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
There is a feature called white-label name servers in Route53 which should do the trick for you:
Each Amazon Route 53 hosted zone is associated with four name servers, known collectively as a delegation set. By default, the name servers have names like ns-2048.awsdns-64.com. If you want the domain name of your name servers to be the same as the domain name of your hosted zone, for example, ns1.example.com, you can configure white-label name servers, also known as vanity name servers or private name servers.
The following steps explain how to configure one set of four white-label name servers that you can reuse for multiple domains. For example, suppose you own the domains example.com, example.org, and example.net. With these steps, you can configure white-label name servers for example.com and reuse them for example.org and example.net.