Search code examples
node.jssslnginxamazon-elastic-beanstalklets-encrypt

AWS Elastic Beanstalk - NodeJS : Get certificate SSL from Letsencrypt without Beanstalk Load Balancer


For my nodejs application in Elastic BeanStalk, without Beanstalk Load Balancer I want to set up a Letsencrypt certificate and keep the classic domain provided by AWS : xxx.xxxx.elasticbeanstalk.com

After several searches I found two possible solutions :

1 - Using an .ebextensions file => to install Certbot, get a Letsencrypt certificate and config Nginx.

great post about that => https://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/

2 - From an ssh connection, install Certbot, generate a certificate and Upload it to IAM AWS.

Docs AWS : https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-ssl-upload.html

For both solutions I have the same error message during domain verification by Certbot.

I think that the directory generated by certbot for the verification isn't accessible..

Error :

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.

So, my question is : What's the best way to setup a SSL Certificate to get the green lock for a Node Js Elastic BeanStalk application without Beanstalk Load Balancer ?

Thank you for your help.


Solution

  • I finally found the solution :

    I took inspiration from this script and created one using WEBROOT MODE.

    I created a git to share this solution :

    https://github.com/SammyHam/LetsEncrypt-SSL-config-for-Elastic-Beanstalk