How to create domain and subdomain in AWS?
Sign in to the AWS Management Console and open the Amplify console . Choose your app that you want to add a custom domain to. In the navigation pane, choose App Settings, Domain management. On the Domain management page, choose Add domain.
The limits are not expressed directly in number of subdomains, but rather in number of records and hosted zones, among other things. Therefore, there is 10,000 records per hosted zone, but it can be increased. Also you can have 500 hosted zones per account.
Using Amazon AWS Route 53 & Apache 2.4 web server
Create a Canonical name with wild card to route all the sub domains traffic to the root web server located.
Now add sub domains details along with root domain routings like below.
# ----------------------------------- # GS - Virtual Host Configurations # ----------------------------------- <VirtualHost *:80> ServerName www.gajen.com ServerAlias gajen.com DocumentRoot "/var/www/html" </VirtualHost> # Stagings # -------- # Discovery <VirtualHost *:80> ServerName discovery.gajen.com DocumentRoot "/var/www/html/discovery" </VirtualHost> # Alpha <VirtualHost *:80> ServerName alpha.gajen.com DocumentRoot "/var/www/html/alpha" </VirtualHost>
I'm finding the other answers here a little cryptic. Here are the main steps for hosting your domain apex and any other host names for that domain in Route53. This is assuming that you've purchased a domain through GoDaddy, or Network Solutions, or wherever. (And as of mid-2014 you can buy domains directly in Route53):
If you run nodes in multiple AWS regions (not just across multiple AZ's) you can also use Route53's "latency based routing," which will direct users to the fastest node given latency at any given moment (it's based on lowest latency, not upon nearest geographic location). Or you can use Route53's healthchecks to set your record values -- e.g. if the healthcheck passes, your A record points to 1.2.3.4, if it fails, the A record points to 5.6.7.8.
EDIT: Another helpful Route53 trick I discovered (by happenstance, though I read later that it's a known/supported feature) is that you can use the A record aliasing to point to ELBs (or buckets, CloudFront distros, etc.) in other AWS accounts. They won't auto-populate in the dropdown list of aliases, but you can just copy+paste them into the "alias target" input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With