TLS Termination Overview0:00
In order for us to use a load balancer, we need to acquire a TLS certificate that will be used to encrypt the traffic between clients and the load balancer. We will later set up the load balancer to accept requests on port 443 and then forward them to the N instances on port 80. This is called TLS termination. The traffic between clients and the load balancer will be encrypted, but the traffic between the balancer and the N instances will not be encrypted. That way, we remove the overhead of the TLS negotiations from our N instances and let the load balancer do that instead. So to get started, let's head over to the AWS dashboard and visit the AWS Certificate
Requesting ACM Certificate0:41
the load balancer do that instead. So to get started, let's head over to the AWS dashboard and visit the AWS Certificate Manager service. We then click on Request to request a certificate. We will select a public certificate and click Next. Then we are going to enter the domain, I'll use the wildcard domain *.gowithbhp.com. For the validation method, I'll stick to DNS validation. Then for the key algorithm, I'll stick to RSA 2048. And finally, let's click on Requests. Now let's refresh this list and we can see that our certificate is pending validation.
Adding DNS CNAME Record1:26
And finally, let's click on Requests. Now let's refresh this list and we can see that our certificate is bending validation. Let's click on the certificate entry and locate the CNAME record AWS wants us to add to validate the domain ownership. Here it is. We copy the CNAME and then we head over to our DNS provider. In that case, it's Cloudflare for me, but you can use any DNS provider you want. And then we create a new record. This record is going to be of type CNAME. And then we paste the request name here.
Cloudflare Proxy Settings2:08
This record is going to be of type CNAME. And then we paste the request name here. Then we go copy the value and paste it in the value field here. We then disable the proxying. So Cloudflare only routes traffic to the load balancer without proxying it through the Cloudflare CDN. If you are using a different DNS provider, this step is unnecessary. But if you are using Cloudflare, I prefer to use it as a proxy only in that case. Now let's click on save and then go to the AWS dashboard. And we go back to the certificates list.
Verifying Certificate Issued2:45
Now let's click on save and then go to the AWS dashboard. And we go back to the certificates list. Our entry is still bending validation. But if we give it a little bit of time and then refresh, we can see that the certificate is issued. We are now ready to use this certificate with our load balancer. That's what we will do in the next video.
