Search code examples
amazon-web-servicesamazon-route53

Best Practices for multiple subdomains in AWS Route 53 Hosted Zone


We have a requirement to have multiple subdomains

- Root Domain: companyname.com 
 - Subdomains: 
    - departmentOne.companyname.com 
      - AppOne.departmentOne.companyname.com
      - AppTwo.departmentOne.companyname.com
    - departmentTwo.companyname.com 
      - AppTwo.departmentTwo.companyname.com

What is the best practice in AWS?

  • Do we just create one HostedZone? and create multiple A-Records
    • companyname.com

OR

  • Do we create multiple HostedZones one per subdomain?
    • departmentOne.companyname.com
    • departmentTwo.companyname.com

Solution

  • well the answer depends on the situation,

    we went with both the approaches for a different reason

    we had standalone and production environments

    1. for standalone we kept it simple since hostedzones cost money and everything stayed on single hosted zone default
    2. For production we did something else, the prod account is a sub-organization and the domain was in a different account we only had access to a subdomain
    3. so we created multiple hosted zones for prod and updated the NS entries into the parent AWS account.