Amazon Web Services offers hosting instances suitable for hosting both general servers and applications, as well as certain additional services. Consequently, there are various options available for installing an SSL certificate on AWS.
This article outlines the steps to install your SSL certificate on several specific Amazon-related applications or services.
Some prerequisite information
For SSL installation you generally need three components: a certificate, an intermediate certificate chain (CA-bundle) and a Private key.
- αα·ααααΆαααααα SSL are sent as a PEM-formatted file with a .crt extension. If the extensions are not shown in your system by default for all files, an SSL will have βSecurity certificateβ in the file description. The same file can be also downloaded ααααΌαβααα.
Inside the file there is a code like this:

- An Intermediate certificate chain (CA-bundle) is also sent in a PEM-format file, but this file has a .ca-ααΆα α extension. Inside the file, there are normally one or two codes similar to the certificate. The CA-bundle, as with the certificate, is usually in the SSL archive you receive after SSL activation.
- A Private Key is generated along with the certificate signing request (CSR) used to activate your SSL. If you generated the CSR on your server, the key is saved in the same place. It has .αααααΉα extensionα
It contains a code like this:

On your server, the content of the files can be checked using the cat command (specify the actual file name in your command):
cat example.crt
On a local machine, you can right-click on the file, select Open with, and choose any plain text editor.
The aforementioned SSL components will sometimes need to be uploaded as files or uploaded as codes, depending on the particular Amazon service you use.
Elastic Compute Cloud (EC2)
If you have EC2, it generally means that a separate web, mail or application server is installed, and the SSL should be installed on that server. For more information on installing SSL certificates, you can refer to instructions αα βααΈααα.
Things will differ slightly if you use the Amazon Linux AMI.
Amazon Linux is a specific Linux distribution provided by Amazon. It is normally based on CentOS Linux with the Apache server installed (though a Debian-based version also exists).
On Amazon Linux 2, the installation process is exactly the same as normal SSL installation on the Apache server on CentOS.
For other versions of Amazon Linux, there is one peculiarity. To run an encrypted HTTPS connection on an Apache web server, mod_ssl needs to be installed with the help of a slightly different command to the one usually used on Apache:
sudo yum install -y mod24_ssl
The default SSL configuration file location on Linux AMI is /etc/httpd/conf.d/ssl.conf. All the changes required to install an SSL can be made within this file.
Elastic Load Balancer (ELB)
A load balancer is a specific service that allows the managing of traffic across several hosting instances. Amazon provides a load balancer service that can be secured with an SSL certificate.
α’αααα’αΆα ααααΎααΆα upload the SSL directly through the graphic interface to AWS certificate manager (ACM) (1) α¬ααααΎααΆ through the command line in the AWS Identity & Access Management (IAM) (2).
- The first option is pretty simple. During the Load balancer creation you can import the new certificate in the second step of the setup:

Simply choose to upload the certificate to ACM (this option sets a default SSL for all unassigned cases) or IAM (this one allows you to add multiple SSLs) and paste all 3 SSL components as codes:
- α αααα Certificate in the βCertificate bodyβ form;
- CA-αααα αα in the βCertificate chainβ form;
- αα·α Private Key in the βPrivate keyβ form.
Choose the security policy from the drop-down list (the default one will work just fine) and proceed with the load balancer setup.
The SSL can be also added later by going to the αααα»ααα»αααααΆα menu >> α’αααααααΆαα >> View/edit certificates.

Click on the + (plus) button to add a new certificate and open the αα·ααααΆααααααααΆαα αΌα αααααα
The form for SSL upload will show:

- αααααΆαα αααααΎαααΈααΈα, upload the certificate, Private key and CA Bundle to your server and open the command line. All three files can be installed using a single command:
aws iam upload-server-certificate βserver-certificate-name certificate_object_name βcertificate-body file://*path to your certificate file* βprivate-key file://*path to your private key file* βcertificate-chain file://*path to your CA-bundle file*
α αααΆα: When you specify a file as a parameter (for example, for the certificate-body αα·α private-key parameters), file:// should be included as a part of the file name.
α αααΆα: α αααα certificate_object_name parameter is used to assign your own name to the certificate so that you can identify it further.
When you upload your certificate files, IAM will validate the files if the following criteria are met:
- Certificates should be in X.509 PEM format.
- The current date should be between the certificateβs issuance and expiration date.
- The certificate and Private key files should contain only a single item, meaning one certificate file and one corresponding key.
- The Private key should match the certificate.
- The Private key should be in PEM format, just like the certificate is. The correct format of the text within the key file should begin with ββBEGIN RSA PRIVATE KEYββ and ends with ββEND RSA PRIVATE KEYββ.
- The Private key should not be encrypted with a password.
Once the files are uploaded, you can verify the certificate information in the IAM store by using the following command:
aws iam get-server-certificate βserver-certificate-name certificate_object_name
αααααααα½αααααΎααα ααΌα ααα:
arn:aws:iam::Your_AWS_Account_ID:server-certificate/Your_Certificate_Object_Name Certificate_Object_GUID
Your_AWS_Account_ID is a unique Amazon Resource Name (ARN) and Certificate_Object_GUID is the ID of the certificate.
αααααΆα§ααΆα ααααα½α:
arn:aws:iam::123456789012:server-certificate/certificate_object_name ADGTHexampleLKBASAH
Digits in the first line are the ARN, and the second line is the certificate ID.
- ααααα·αααΎα’αααααααΌαααΆα ααααΎα±ααααΆαααααα the certificate for a HTTPS load balancer, you will need to use the ARN of the certificate. The following command is used in such a case to set the certificate for the load balancer:
aws elb set-load-balancer-listener-ssl-certificate βload-balancer-name my-loadbalancer βload-balancer-port 443 βssl-certificate-id arn:aws:iam::123456789012:server-certificate/certificate_object_name
Parameter my-loadbalancer is the name of your load balancer.
For more details about creating a HTTPS load balancer and setting its name, please check the following guide.
AWS API Gateway
By default, Amazon API uses a default access link αααααΎααα
ααΌα
αααα
https://api-id.execute-api.region.amazonaws.com/stage
In some cases, itβs more convenient to set up a custom hostname for it instead. The custom link can be also secured with an SSL certificate.
The process is similar to the load balancer securing.
- Log in to the AWS Certificate Manager console.
- Choose the Import a certificate option.
- A similar form for the SSL upload will open.

- Paste the certificate file code as the βCertificate bodyβ, CA-bundle code as the βCertificate chainβ and Private key code as the βCertificate private keyβ and click Next.
- Save the changes by selecting the αα·αα·ααα αα·αααΆαα αΌα αααααΎαα
- ααααΎα ααααΆαααααα½α αααααααα ααααα ααΈ α αααααααΆα API α αααΊαα»αα
- Choose your custom domain name.
- α α»α αααααα.
- Choose the correct SSL from the drop-down list and save the changes.

Keep in mind! The certificate may take up to 40 minutes to apply.
Alternatively, you can also install an SSL through the domainname:update API-call via the command line.
The request itself will look like this:
PATCH /domainnames/*Your API domain name*
{
βpatchOperationsβ : [ {
βopβ : replace,
βpathβ : *parameter used to identify the SSL*,
βvalueβ : *parameter value*,
βfromβ : // optional parameter where you can specify what specific part of the application should use the SSL.
} ]
}
More details about the command can be found αα βααΈααα.
Amazon CloudFront
Amazon CloudFront is a web service that allows you to speed up content distribution in different locations by caching some of it in a special storage.
You can either upload an SSL certificate through SSL manager or through the command line, as described above in the section βAWS API Gateway"α
After adding the SSL, CloudFront settings need to be updated as follows:
- Open your AWS console and go to the CloudFront console.
- Choose the ID of the CloudFront entity that needs to be updated.
- α αΌααα ααΌαα ααααΆααα αΎαααααΎα αααααα.

ααααΎαα αα α»ααααααααΆα Alternate Domain Names (CNAMEs) with your SSL domain name(s) and choose the correct SSL from the list.

5 α α
α»α
Yes, Edit.
6. After this, you can go to the α’αΆαααααα·αα·ααΆ tab and either set a redirect from HTTP to HTTPS or set the Cloudfront to HTTPS only.

The SSL can be set up during the CloudFront entity creation also.
α αααΆα (Note): If you want to use an ACM certificate with Amazon CloudFront, make sure you import a certificate stored in the US East (N. Virginia) region. Otherwise, use the certificate imported to IAM.
You can verify that a certificate has been installed correctly by checking directly or using an online checker, such as αα½αβααα.