Multiple SSL Certificates on Elastic Beanstalk ALB - amazon-web-services

Is it possible to link more than 1 SSL certificate to an Elastic Beanstalk ALB?
I understand that one can create a bundle domain certificate in Certificate Manager, but I would ultimately want to give my clients the ability to add their own domain pointers pointing to the EB environment.

Yes, you can do this. Probably not from EB console, but you can deploy multiple SSL certs on ALB as explained in:
Application Load Balancers Now Support Multiple TLS Certificates With Smart Selection Using SNI
You would have to go to EC2 console -> Load balancers, and work with the ALB there. Obviously you could do the same things using AWS CLI or SDK if you want to automate things.

Related

AWS Install SSL Certificate from Certificate Manager on EC2

I am using AWS and I created an Instance in EC2 and created a SSL Certificate in Certificate Manager, I have a domain from whois.com which I was able to connect to my instance using Route 53.
I am now trying to install the SSL Certificate to my EC2 instance and have googled a bunch on tutorials on the subject, but they all are super confusing and don't seem to work, must of them say I need to use a Load Balancer, but either I am missing a step or something I am doing is wrong because the SSL certificate is not working, http works like a charm, https is not working at all.
Is someone able to point me in the right direction?
AWS do not allow the certificates to be downloaded for ACM public CA so you are limited with where it can be attached.
You cannot use a public ACM certificate directly in your EC2 instance. The following resources support attachment for HTTPS of your application:
Elastic Load Balancer (ALB, CLB or Network Load Balancer with a TLS target group)
CloudFront Distribution
API Gateway
If you do not want to use one of these resources then the following 3 options are available for you:
Use a free SSL CA to generate the SSL for your EC2 instance such as certbot
Purchase a SSL from another CA and install on your host
Use AWS ACM Private CA (Although this can be expensive)

Https on Elastic Beanstalk Without Load Balancer

I would like to decrease my AWS bill and deactivate load balancing on some of my elastic beanstalk applications.
I managed to setup https through AWS Certificate Manager with the free Amazon issued certificates.
When I remove the load balancing, I don't have the option to setup the SSL certificate. Any ways to add it somewhere else, like from the EC2 instant linked to EBS?
Thanks for your help,
You can't use ACM certificates without either a load balancer or a CloudFront distribution. If you don't have either of those, you will need to obtain an SSL certificate through some other means, and install it on your web server software running on the EC2 instance.

AWS Certificate Manager Certificate is not visible to AWS Beanstalk from Console

I am new to AWS and need help to select the AWS Certificate Manager provisioned Certificate from Elastic Beanstalk Loadbalancer using AWS Console.
Deployed my Java application on Linux instance using Elastic
Beanstalk and that worked fine with Http.
Provisioned a new wildcard certificate using AWS Certificate Manager.
Under Elastic Beanstalk Configuration - Network Tier - Load Balancing Settings gear Icon, I changed "Secure listener port" = 443 and "Protocol" =
HTTPS.
But the "SSL Certificate ID" does not list the certificate to pick.
Please suggest what is that I am missing here.
I have read many suggestions to do by CLI but I am not an CLI expert and wanted to use the console feature for simplicity.
EDIT-1:
I can see the certificate under EC2 - Load Balancer - Listener TAB if I try to add HTTPS, but not under Beanstalk. I am not sure if I shall add this listener under EC2 or not, but I think I need to add SSL to Beanstalk as My application get deployed using Beanstalk into EC2.
This will happen if you created your SSL Certificate on a different Region to your Elastic Beanstalk instance. An easy gotcha!
To setup a SSL certificate for your Elastic Beanstalk environment, please see Configuring Your Elastic Beanstalk Environment's Load Balancer to Terminate HTTPS
There is a console setup step as you describe in step 3, so that looks good. Also note you need to update the EB configuration as shown in the above document.
From AWS documentation:
For Classic Load Balancer and Application Load Balancer, if the
drop-down menu doesn't show any certificates, you should create or
upload a certificate for your custom domain name in AWS Certificate
Manager (ACM) (preferred). Alternatively, upload a certificate to IAM
with the AWS CLI.
I guess AWS CLI with IAM must be used as described here

Configure SSL certificate by ACM on single instance tomcat on AWS

I have created a single instance web application on AWS with Elastic Beanstalk. Now I want to add ssl certificate to enable https access on it.
I created a ssl certificate using ACM and I was folowing this! link to add it to my web app in Elastic Beanstalk.
But I could not find and anywhere in acm.
How can i find them??
You can only use ACM with CloudFront or Elastic Load Balancers. Since you don't have an Elastic Load Balancer in a single instance Elastic Beanstalk environment, you can't use ACM, unless you want to put CloudFront in front of it.

How to add SSL certificate to AWS EC2 with the help of new AWS Certificate Manager service

AWS has come up with a new service AWS Certificate Manager. One thing I got from the description is that if we are using this service we don't have to pay for the certificate anymore.
They are providing certificates for Elastic Load Balancer (ELB) and CloudFront, but I didn't find EC2 anywhere.
Is there any way to use the certificate with EC2?
Q: Can I use certificates on Amazon EC2 instances or on my own servers?
No. At this time, certificates provided by ACM can only be used with specific AWS services.
Q: With which AWS services can I use certificates provided by ACM?
You can use ACM with the following AWS services:
• Elastic Load Balancing
• Amazon CloudFront
• AWS Elastic Beanstalk
• Amazon API Gateway
https://aws.amazon.com/certificate-manager/faqs/
You can't install the certificates created by Amazon Certificate Manager (ACM) on resources you have direct low-level access to, like EC2 or servers outside of AWS, because you aren't provided with access to the private keys. These certs can only be deployed on resources managed by the AWS infrastructure -- ELB and CloudFront -- because the AWS infrastructure holds the only copies of the private keys for the certificates that it generates, and maintains them under tight security with auditable internal access controls.
You'd have to have your EC2 machines listening behind CloudFront or ELB (or both, cascaded, would also work) in order to use these certs for content coming from EC2... because you can't install these certs directly on EC2 machines.
No, you cannot use aws certificate manager for deploying certs on EC2. The certificate manager certs can only be deployed against cloudfront and elastic load balancer. Inoredr to use it on ec2, you need to put elb on top of ec2, so that request from client to load balancer will be https protected and from elb to ec2 webserver will be on http.
If you are using AWS ACM Cert for internal purpose only then you could probably use AWS ACM Private CA to issue the certs.(I think you can use it for public/external traffic purpose as well if your root CA is publicly trusted CA).
https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaGetStarted.html
During Application/EC2/Container startup, set a step to export your ACM Private CA issued Cert/Private Key to your destination and start referring that for serving the traffic.
https://docs.aws.amazon.com/cli/latest/reference/acm/export-certificate.html
One good thing is, you can control who can call export cert feature using IAM Role so not everyone can download private key of the cert.
One downside with this is, private CA is expensive AWS service($400/month).
https://aws.amazon.com/certificate-manager/pricing/
Adding to the comments above, you can't use the AWS Certificate Manager for this, but you can add a Let's Encrypt certificate to ec2 on a Windows server running IIS and it's pretty easy:
Associate an elastic ip with your ec2 instance.
Make sure you have a registered domain. You can't use ec2----------.us-east-1.compute.amazonaws.com type names that come with your instance.
Through your domain provider's DNS settings have your domain point to your Elastic IP.
Connect to your ec2 instance and add your domain name to the site bindings.
Go to https://github.com/PKISharp/win-acme/releases
Look under assets, and use the latest version (win-acme.v2.0.10.444.zip for example). This is the only assets folder that you need.
Unzip the folder, open the terminal as administrator, and cd into the unzipped folder.
Run wacs.exe and follow the prompts.
Make sure the security group assigned to your instance allows traffic (at the very least your own IP) through the HTTPS port you chose in IIS; this is port 443 by default.
I found the links below helpful when I was figuring this out. Here is a video using an earlier release if you need more help, but it's the same idea.
https://www.youtube.com/watch?v=fq5OUOjumuM
Also this article might be helpful:
https://weblog.west-wind.com/posts/2016/feb/22/using-lets-encrypt-with-iis-on-windows