How to add HTTPS listener to EC2 ALB

0

I've created a cluster in EKS and added ALB Load Balancer to that cluster. Now i need to add https listener to the ALB as in link below, but i cannot create a certificate in ACM, as i don't own a domain. https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html

Please advise any workaround to achieve this ?

doaa
asked 6 months ago173 views
2 Answers
1

Hello.

To issue an SSL certificate with ACM, you need a public domain that you have purchased yourself.
I think it is better to purchase public domain.
Domain pricing is listed below.
https://d32ze2gidvkk54.cloudfront.net/Amazon_Route_53_Domain_Registration_Pricing_20140731.pdf

If you use other methods, you may be able to use a self-certificate.
https://docs.aws.amazon.com/acm/latest/userguide/import-certificate-prerequisites.html

profile picture
EXPERT
answered 6 months ago
profile picture
EXPERT
reviewed 6 months ago
0
Accepted Answer

In addition to what Riku said, you can also create a self-signed certificate, and then import that into ACM, and deploy that to your ALB Listener.

You can do this directly with OpenSSL on MacOS or on Linux as follows:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/my-selfsigned.key -out /etc/ssl/certs/my-selfsigned.crt

Then you can import the certificate to ACM using the CLI as follows:

$ aws acm import-certificate --certificate fileb://etc/ssl/certs/my-selfsigned.crt --private-key fileb://etc/ssl/private/my-selfsigned.key

You may need to change the file-paths depending on where your certificate and key is. Refer to the documentation on exactly how to do this: https://docs.aws.amazon.com/acm/latest/userguide/import-certificate-api-cli.html#import-certificate-cli

Once you have done this - the self-signed certificate can be used on an ALB.

Note with imported certificates - you need to take care of renewing them - so Riku's advice to get a real domain is the most robust way forward in production. Self signed certificates are not generally trusted by most client machines.

AWS
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions