Apply SSL Certificate To Application Loadbalancer
In the previous articles , I have explained how we can
Create application load balancer in AWS
Configure path based routing on application load balancer
Generate SSL certificates using AWS Certificate manager
In this guide , We will learn How we can use SSL/TLS certificate generated using AWS certificate manager for our domain in the Application load balancer.
ACM can be integrated with the Elastic Load balancing.
First We need to generate the SSL certificate for our domain using ACM , Or we can import the existing SSL certificates to the ACM in the same region as the load balancer
Then we can associate the certificates to the Load balancers.
In order to use SSL/TLS certificate in the load balancer , We need use HTTPS listener in the load balancer.
Then the load balancer will use the certificate and then decrypts the client request at the frontend before send them the response.
A listener checks for the incoming requests / connections.
We can define HTTP and HTTPS listeners on the load balancers.
We can create or modify HTTP and HTTPS listeners any time in the load balancer.
When we create HTTPS listener, It enable encryption between the load balancer and clients.
Amazon recommend to use the AWS Certificate Manager for the load balancer.
How Certificate Renews
Each certificate we generate or purchase comes with a validity period.
So we must ensure that the certificates are renewed before its validity ends.
- If the certificate for the load balancer is provides by AWS certificate manager , Then the certificate will be automatically renewed by the AWS.hence the new requests will be served using new certificates.
- If the certificate is imported into the ACM, Then we need to setup monitoring for ssl certificate expiry and renew it before the validity ends.
Adding HTTPS Listener
While creating / updating listener , We can configure the protocol and the port for the incoming connections form the users.
Open the EC2 console , In the left navigation pane , Choose Load balancers
and then choose Listeners and then click Add listener
Each listeners will have a target groups.Hence any incoming requests to the load balancer will be forwarded to the instances in the target group and the response will be served to the clients.
Set the protocol and the port as HTTPS : 443
Under Defaut actions
You can forward the requests to the target group or you can redirect any incoming request to https.
You can redirect any incoming requests from protocol http and port 80 to https :443.
Also you can redirect to any custom URL.
For security policy , Keep the default security policy.
Under Default SSL certificate , Choose From ACM (recommended)
Select the certificate you have generated using the ACM or you can import the certificate.
and then click Save
Updating HTTPS Listener
We can update the existing HTTPS listener by replacing the existing certifcate from ACM or If you have uploaded a certificate to IAM we can choose that certificate and also we can modify the security policies.
Limitations On Application Load Balancer
- load balancer : 50
- target groups : 3000
- Certificates per load balancer : 25
- Rules per load balancer : 100
- Target groups per load balancer : 100
We have learnt how we can create an apply SSL certificate to the application load balancer , So the connection will be encrypted between the load balancer and the end users.
Hope you find it helpful.
Please do check out my other articles.