Configuring HTTPS for your Elastic Beanstalk environment
If you've purchased and configured a custom domain name for your Elastic Beanstalk environment, you can use HTTPS to allow users to connect to your web site securely. If you don't own a domain name, you can still use HTTPS with a self-signed certificate for development and testing purposes. HTTPS is a must for any application that transmits user data or login information.
The simplest way to use HTTPS with an Elastic Beanstalk environment is to assign a server certificate to your environment's load balancer. When you configure your load balancer to terminate HTTPS, the connection between the client and the load balancer is secure. Backend connections between the load balancer and EC2 instances use HTTP, so no additional configuration of the instances is required.
With Amazon Certificate Manager (ACM)
To use an ACM certificate with Elastic Beanstalk, see Configuring your Elastic Beanstalk environment's load balancer to terminate HTTPS.
If you run your application in a single instance environment, or need to secure the connection all the way to the EC2 instances behind the load balancer, you can configure the proxy server that runs on the instance to terminate HTTPS. Configuring your instances to terminate HTTPS connections requires the use of configuration files to modify the software running on the instances, and to modify security groups to allow secure connections.
For end-to-end HTTPS in a load-balanced environment, you can combine instance and load balancer termination to encrypt both connections. By default, if you configure the load balancer to forward traffic using HTTPS, it will trust any certificate presented to it by the backend instances. For maximum security, you can attach policies to the load balancer that prevent it from connecting to instances that don't present a public certificate that it trusts.
You can also configure the load balancer to relay HTTPS traffic without decrypting it. The down side to this method is that the load balancer cannot see the requests and thus cannot optimize routing or report response metrics.
If ACM is not available in your region, you can purchase a trusted certificate from a third party. A third-party certificate can be used to decrypt HTTPS traffic at your load balancer, on the backend instances, or both.
For development and testing, you can create and sign a certificate yourself with open source tools. Self-signed certificates are free and easy to create, but cannot be used for front-end decryption on public sites. If you attempt to use a self-signed certificate for an HTTPS connection to a client, the user's browser displays an error message indicating that your web site is unsafe. You can, however, use a self-signed certificate to secure backend connections without issue.
ACM is the preferred tool to provision, manage, and deploy your server certificates programmatically or using the Amazon CLI. If ACM is not available in your Amazon Region, you can upload a third-party or self-signed certificate and private key to Amazon Identity and Access Management (IAM) by using the Amazon CLI. Certificates stored in IAM can be used with load balancers and CloudFront distributions.
The Does it have Snakes?
Topics
- Create and sign an X509 certificate
- Upload a certificate to IAM
- Configuring your Elastic Beanstalk environment's load balancer to terminate HTTPS
- Configuring your application to terminate HTTPS connections at the instance
- Configuring end-to-end encryption in a load-balanced Elastic Beanstalk environment
- Configuring your environment's load balancer for TCP Passthrough
- Storing private keys securely in Amazon S3
- Configuring HTTP to HTTPS redirection