Assigning a subdomain to a Beanstalk application with AWS Route 53

In a previous post I wrote about how to run a Spring Boot application on AWS by using Elastic Beanstalk. I also described earlier how to make your Spring Boot application making use of HTTPS instead of HTTP in combination with BoxFuse. I ended up in that solution to include the necessary SSL certificate in my application sources. Another way to accomplish the SSL connection would be to have the Elastic Load Balancer (ELB) in the Beanstalk Application terminate the SSL for us and let the Spring Boot application just communicate over HTTP with the ELB. This set up might be a very handy (perhaps minimal but sufficient) way to add security to the communication level of the API/web application.
To accomplish this set up I need to take several steps of which I will describe the first one in this post. The steps to perform are:

  • Assign a (sub)domain to a Beanstalk application
  • Obtain a certificate for the subdomain from the AWS Certificate Manager
  • Configure AWS Beanstalk application to use SSL

As said before in this post I will only show how to assign a subdomain to the Beanstalk instance. In my situation the parent domain is registered elsewhere (a provider other than AWS). The parent domain that I have registered is ‘’. The sub-domain I want to register is ‘’.

The first step is to create a new Hosted Zone in AWS Route 53. Since this is something I will do only once I chose to do this by the Management Console because no scripting will be necessary here. In the Management Console I open up Route 53 and click the button ‘Create Hosted Zone’. Just fill in the fields and click ‘Create’:


The Hosted Zone is created together with two Record Sets, one of type ‘NS’ and one with type ‘SOA’ which are shown in the next screen:

Screenshot at Aug 11 09-06-17

Next step is to create a ‘A’ record pointing to the Beanstalk application. You can simply fill the screen after clicking ‘Create Record Set’ like this:

Screenshot at Aug 11 09-10-38
Just make sure you select ‘alias’ as ‘yes’ so you can pick your Elastic Beanstalk application as ‘Alias Target’ for the domain name. To get more info about the other options see the documentation of Route 53.

The final step to get this working is adding some DNS records at your top level domain provider. With these records we will tell the provider that for that subdomain it should use AWS Route 53 DNS servers to resolve the domain name. Now this step will be different for each provider but in the end you will have to add a record set like these:
Screenshot at Aug 11 13-27-40

To get the AWS Route 53 servers select the hosted zone in the Management Console and you will see the servers at the right side of the panel:

Screenshot at Aug 11 13-19-35

When all this is in place you are automatically taken to the Elastic Beanstalk application when calling for ‘‘:

Screenshot at Aug 11 13-29-38

(Please note it may take some time before all necessary DNS servers are updated with the new information.)

About Pascal Alma

Pascal is a senior software developer and architect. Pascal has been designing and building applications since 2001. He is particularly interested in Open Source toolstack (Mule, Spring Framework, JBoss) and technologies like Web Services, SOA and Cloud technologies. Lately he is having great fun by building iOS apps with Swift. Specialties: JEE AWS XML/XSD/XSLT Web Services/SOA Mule ESB/ WSO2 ESB Maven Cloud Technology Swift/ iOS
This entry was posted in AWS, Security and tagged , , . Bookmark the permalink.

4 Responses to Assigning a subdomain to a Beanstalk application with AWS Route 53

  1. Pingback: Java Web Weekly, Issue 139 | Baeldung

  2. Pingback: Get a Certificate from AWS Certificate Manager | The Pragmatic Integrator

  3. Pingback: Configure AWS Elastic Beanstalk application to use SSL | The Pragmatic Integrator

  4. Pingback: Configure AWS Elastic Beanstalk Application to Use SSL -

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s