Search code examples
amazon-cloudfrontamazon-route53

Adding Sub-domain in Route53 for CloudFront


I followed the steps on creating sub-domain via Route53 by creating a new Hosted Zone for cdn.domain.com and added the NS to the registrar in addition to the root domain, domain.com NS.

I then added Alternate Domain Name in the CloudFront Distribution that reads cdn.domain.com and saved it. I then waited for the status to get deployed.

My question is,

  1. Do I still need to add an A record for the sub-domain that I created? If so, where will it route?

  2. If I don't need to create an A Record, shall I add a new record CNAME on the root domain Hosted Zone or on the sub-domain Hosted Zone? Because I see no target Available.

IPV6 is also enabled on the CloudFront Distribution. Please advise on what would be my next step.

Thank you!


Solution

  • I'm not familiar with the method of multiple hosted zones for the same domain, be sure to use the correct NS servers. (see here)

    The simple approach is to on the root domain add an A record for the subdomain, with an alias set to the CloudFront distribution.