This tutorial guides you through the process of creating a subdomain using Amazon Route 53 and seamlessly integrating it with an Elastic Beanstalk environment. Learn how to establish a distinct subdomain, enabling you to organize and host various applications efficiently.
Hosted zones on the route53 dashboard

Click on Create hosted zone button

Domain name field enter the full url to your subdomainDescription field Write a description of your choiceType select Public hosted zone

Create hosted zone orange button

Should see a page like this if successful

Scroll down a bit on your newly created subdomain and copy the NS values, all four of them

Hosted zone from the left navigation paneIn the primary domain page click on Create record

Record name type your subdomain name Don’t include the primary domain name, it will be added by defaultRecord type Select NS from the listValue Paste the NS Values you copied from the subdomainRouting policy Select Simple routingDefaultThen Click on Create records button

Successful message should appear if it went well
Type Certificate manager on the search box and click on the search result

Click on the orange color Request a certificate button

Select Request a public certificate Then click Next

Fully qualified domain name Enter your subdomain name including the primary domain nameValidation method Select DNS validation - recommendedKey algorithm Select RSA 2048
If successful, Status should display Pending validation
Click on the Certificate ID or Name

Click on Create records in Route 53 button

Click on the Create records button

If DNS record creation successful

Pending validation to Issued

Search for elastic beanstalk and click on it

Click on the name of your elastic beanstalk Environment name

Click on Configuration from the left pane and scroll down

If your Load balancer under Instance traffic and scaling category, under Capacity is not editable. Click edit on the Instance traffic and scaling category.

Note: You selected Single instance rather than Load balanced when creating your elastic beanstalk, which is why your load balancer details are not displayed.
Still under Instance traffic and scaling under Capacity then Auto scaling group then Environment type Select Load balanced then scroll down

On Listeners Click Add listener button

Add listener form
Listener port select 443Listener protocol select HTTPSSSL certificate choose the certificate you createdSSL policy Choose any on 2023Default process leave it on default
Hosted zones on the route53 dashboard

Click on your subdomain name, then click on the Create record button

The initial create record should look like this

Record name Leave it as isRecord type select A - Routes traffic to an IPv4 address and some AWS resourcesAlias buttonRoute traffic to fields
Choose endpoint select Alias to Elastic Beanstalk environmentChoose region select your regionChoose environment select your elastic beanstalk environmentRouting policy select Simple routingEvaluate target health can be Yes

Load Balancers on the side menu


HTTP:80 at the bottom

default

Actions then click on Edit rule

Listener details and Listener configuration as it is. Then fill out the Default actions category
Routing actions tick Redirect to URLRedirect to URL select URI partsProtocol select HTTPSPort type 443Status code select 301 - Permanently movedSuccessfully modified listener message should display if successful
Enter your newly created subdomain in a browser, it should have https.