I have a Java war that I want to host on elastic beanstalk on AWS. I have a certificate but I am not able to figure out how to attach it to my single instance app.
All the howtos describe how to attach the certificate to elastic load balancer but no document on how to do it without load balancer (i.e. single instance).
I don't want to use load balancer because it costs extra (and not needed in testing environment).
Any help will be appreciated.
This solution uses LetsEncrypt free certs, and doesn't require storing your certs in a config file. And its easy to reuse for different domains.
http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
Summary: a config file with container commands that automates downloading certbot, getting a cert, and pointing nginx to the cert.
Elastic Beanstalk single instance type did not support SSL via Management Console or API. You can find more information in AWS Forums.
But you can use Configuration File to customize your instance to enable SSL. Please see the following example.
.ebextensions
directory in the top-level of your source bundle.SSLCertificateFile.crt
,SSLCertificateKeyFile.key
,SSLCertificateChainFile.crt
andssl.conf
(apache2 ssl module configuration) into.ebextensions
/your_app/.ebextensions/01ssl.config
. Type the following01ssl.config
inside the configuration file to configure ssl settings01ssl.config
ssl.conf example
Your WAR structure should look like
2013/11/14 Updated.
Using configuration file should pay attention to security problems, because the files in the folder .ebextensions are accessible for everyone.This may not happen in usual situation.