So you built something on Elastic Beanstalk and now you want it to stop living at some sad myapp.elasticbeanstalk.com address. Welcome to DNS fun where patience meets propagation and everyone pretends caches are fast. This guide shows how to use Route 53 hosted zones with alias records and CNAME entries to give your Beanstalk app a real domain name. Yes it is boring, yes it works, and no you do not need to sacrifice a serverless goat to get it live.
High level steps you will take
Before you begin verify these items
Launch or pick the environment in the AWS console. Note the environment name and the platform. In the environment details you will see a domain such as myapp.elasticbeanstalk.com. Most environments sit behind a load balancer. That is what you will usually point DNS at, because it is the thing that actually receives traffic.
Open the environment and copy either the environment endpoint or the load balancer DNS name from the environment details. The environment endpoint is handy for a quick CNAME. If you prefer to be explicit find the Application Load Balancer DNS name in the EC2 console under load balancers.
In Route 53 create a hosted zone that matches your domain name if you do not already have one. Make sure the registrar for the domain points at the Route 53 name servers for that hosted zone. If the domain registrar is not pointing at the hosted zone then the records you add here will be ignored by the internet.
Rules to follow and why they exist
Example using the console
DNS is patient. You are not. Use these commands to confirm what the world sees
dig +short example.com
dig +short www.example.com
nslookup example.com
nslookup www.example.com
Remember caches can take time to clear. If the records look right locally but not globally give it some minutes and try again. TTL settings control how long caches keep old answers.
Mapping a domain to Elastic Beanstalk is not rocket science. It can feel dramatic though because DNS is slow and immortal. Use alias records for the root, use CNAME for subdomains, point to the load balancer when possible, and check with dig or nslookup when in doubt. Now go enjoy that shiny domain you earned with a few clicks and a little patience.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.