amazon-web-servicesterraformamazon-route53

AWS Route53 public zone name servers and record type NS records


For a AWS Route53 public zone created, I notice a default delegation set created with NS & SOA records. But the name servers at the zone and the NS record type seems to have a slight difference. What I mean is: enter image description here

I notice the name server records ending with a period as highlighted in the records section. But in the hosted zone details, there aren't any period that end the name server record. Why is it so, is there a difference that needs to be understood. Couldn't get any info from AWS?

When I pull the record via terraform, it returns the ns records without the period. Currently there's no data resource support from terraform to pull the ns records from the records section.


Solution

  • The rationale behind why the records have a trailing period, and the hosted zone domain names no longer (as of provider version 3.0) have a trailing period in the data source can be best explained in the 3.0 upgrade guide:

    Removal of trailing period in name argument

    Previously the data-source returned the Hosted Zone Domain Name directly from the API, which included a . suffix. This proves difficult when many other AWS services do not accept this trailing period (e.g. ACM Certificate). This period is now automatically removed. For example, when the attribute would previously return a Hosted Zone Domain Name such as example.com., the attribute now will be returned as example.com. While the returned value will omit the trailing period, use of configurations with trailing periods will not be interrupted.

    The trailing periods in the records are correct, and argument values in Terraform with trailing periods in this situation are automatically added or omitted on READ and WRITE operations to be completely accurate and convenient for the user.