This can be done through AWS's Certificate Manager service.
Click here to view the steps
- Open the Elastic Beanstalk console, and then select your environment
- In the navigation pane, choose Configuration
- In the Load balancer category, choose Modify
- To add the listener for port 443, choose one of the following sets of steps based on the type of load balancer in your Elastic Beanstalk environment
For a Classic Load Balancer:
- Choose Add Listener
- For Port, enter the incoming traffic port (typically 443)
- For Protocol, choose HTTPS
- For Instance Port, enter 80
- For Instance Protocol, choose HTTP
- For SSL certificate, choose your certificate, and then choose the SSL policy that you want to use from the drop-down menu
- Choose Add, and then choose Apply
For an Application Load Balancer:
- Choose Add Listener.
- For Port, enter the incoming traffic port (typically 443).
- For Protocol, choose HTTPS.
- For SSL certificate, choose your certificate, and then choose the SSL policy that you want to use from the drop-down menu.
- Choose Add, and then choose Apply.
For a Network Load Balancer:
- Choose Add Listener.
- For Port, enter the incoming traffic port (typically 443).
- Choose Add, and then choose Apply
Configure security groups of load balancer and instances to allow the connection through HTTPS (443 port)
- Locate the Security Groups by navigating to EC2 service from the AWS console
- From there, you should see Securty Groups in the left sidebar
- There must be 2 different security groups there:
- One for AWSEB (AWS Elastic Beanstalk)
- Other for AWSEBLoadBalancer (as the name says, this is for the load balancer)
-
Edit inbound rules
- Open 443 port to allow traffic from the internet through https
- The added entry should look like this:
- Type: HTTPS
- Protocol: TCP
- Port range: 443
- Source: 0.0.0.0/0
-
Edit outbound rules
- Allow traffic through HTTPS (443 port) to go from the load balancer to the Elastic Beanstalk app
- The added entry should look like this:
- Type: HTTPS
- Protocol: TCP
- Port range: 443
- Destination: Security group of Elastic Beanstalk (AWSEB)
- Edit inbound rules
- Allow traffic to come from the Load balancer through HTTPS (443 port)
- The added entry should look like this:
- Type: HTTPS
- Protocol: TCP
- Port range: 443
- Source: Security group of the Load Balancer (AWSEBLoadBalancer)
Here is the link to the steps