How do I associate my domain name with my AWS applications?
-
26-10-2019 - |
Question
I've just starting using the Amazon Web Services (AWS) and I'm still learning about how it works and what features it provides. I have successfully built two of the sample Java webapps and uploaded them to hosted instances on AWS. If I go to the Elastic Beanstalk tab in my AWS Management Console, I can see each of my hosted webapps, including a URL link to each webapp. The URLs are of the format:
http://myinstancename.elasticbeanstalk.com
I also own a personal domain name. Let's call it "mydomain.com". The domain registrar provides a DNS maintenance page where I can change the A and CNAME records for my domains.
QUESTION: Is it possible for me to configure my domain DNS in conjunction with my AWS account such that I can make my AWS-hosted webapps appear with URLs like this:
http://myinstancename.mydomain.com
Solution
First, I don't know if you use an Elastic IP, it's great:
- create and attach an elastic IP to one of your instance
- you have your static IP
- add a new
*
sub-domain in your DNS zone, and register aA record
with your static IP - wait from few hours to 2 days for the DNS propogation
What is really cool with Amazon Elastic IP is that you can rapidly remap it to any other instance and your domain will work instantly without having to change again your DNS zone and waiting for the propagation.
(Elastic IP is free of charge. You pay a small fee only if you don't use it).
Then, if you want to map $1.yourdomain to $1.elasticbeanstalk, personally I will use a proxy/load-balancer like nginx or haproxy, and add a proxy pass. Do you already choose/use one? Which one?
OTHER TIPS
This link maybe useful http://blog.wookets.com/2011/11/amazon-elastic-beanstalk-with-ssl.html works perfect for me