

# Secure Lightsail CDN distributions with SSL/TLS certificates
<a name="amazon-lightsail-create-a-distribution-certificate"></a>

You can create Amazon Lightsail TLS/SSL certificates for your Lightsail distributions. When you create a certificate, you specify the primary and alternate domain names for the certificate. When you enable custom domains for your distribution, and choose the certificate, those domains are added as the custom domains of your distribution. After you update the DNS record of your domains to point to your distribution, your distribution accepts the traffic and serves your content using HTTPS. There is a quota for the number of certificates that you can create. For more information, see [Lightsail service quotas](https://docs.aws.amazon.com/general/latest/gr/lightsail.html#limits_lightsail).

For more information about SSL/TLS certificates, see [SSL/TLS certificates](understanding-tls-ssl-certificates-in-lightsail-https.md).

**Important**  
The domain names you specify when creating an SSL/TLS certificate for your distribution cannot be in use by another distribution across all Amazon Web Services (AWS) accounts, including distributions on the Amazon CloudFront service. You will be able to create the certificate for the domains, but you will not be able to use the certificate with your distribution.

## Prerequisite
<a name="create-distribution-prerequisite"></a>

Before you get started, you need to create a Lightsail distribution. For more information, see [Create a distribution](amazon-lightsail-creating-content-delivery-network-distribution.md) and [Content delivery network distributions](amazon-lightsail-content-delivery-network-distributions.md).

## Create an SSL/TLS certificate for your distribution
<a name="create-distribution-certificate"></a>

Complete the following procedure to create an SSL/TLS certificate for your distribution.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Networking**.

1. Choose the name of the distribution for which want to create a certificate.

1. Choose the **Custom domains** tab on your distribution's management page.

1. Scroll down to the **Attached certificates** section of the page.

   All of your distribution certificates are listed under the **Attached certificates** section of the page, including certificates created for other distributions, and certificates that are in use and not in use.

1. Choose **Create certificate**.

1. Enter a unique name in the **Certificate name** text box to identify your certificate. Then, choose **Continue**.

1. Enter the primary domain name (e.g., `example.com`) that you want to use with the certificate into the **Specify up to 10 domains or subdomains** field.

1. (Optional) Enter alternate domain names (e.g., `www.example.com`) into the remaining **Specify up to 10 domains or subdomains** fields.

   You can add up to nine alternate domains to your certificate. You will be able to use all of your certificate's domains with your distribution after you enable custom domains and select the certificate for your distribution.

1. Choose **Create**.

   Your certificate request is submitted, and the status of your new certificate is changed to **Attempting to validate your certificate**. During this time, Lightsail attempts to add the certificate's validation record to the DNS of the primary domain. After a while, the status will change to **Valid**.

   If automatic validation fails, you will be required to validate the certificate with your domains before you can use it with your distribution. For more information, see [Validate SSL/TLS certificates for your distribution](amazon-lightsail-validating-a-distribution-certificate.md).

**Topics**
+ [Prerequisite](#create-distribution-prerequisite)
+ [Create an SSL/TLS certificate for your distribution](#create-distribution-certificate)
+ [View SSL/TLS certificates](amazon-lightsail-viewing-distribution-certificates.md)
+ [Validate SSL/TLS certificates](amazon-lightsail-validating-a-distribution-certificate.md)
+ [Configure TLS protocol](amazon-lightsail-configure-distribution-tls-version.md)
+ [Delete distribution certificates](amazon-lightsail-deleting-distribution-certificates.md)

# View SSL/TLS certificates for Lightsail distributions
<a name="amazon-lightsail-viewing-distribution-certificates"></a>

You can view the Amazon Lightsail SSL/TLS certificates that you created for your Lightsail distributions. You do this by accessing the management page of any distribution in the Lightsail console.

For more information about SSL/TLS certificates, see [SSL/TLS certificates](understanding-tls-ssl-certificates-in-lightsail-https.md).

## Prerequisites
<a name="view-distribution-certificates-prerequisite"></a>

Before you get started, you need to create a Lightsail distribution. For more information, see [Create a distribution](amazon-lightsail-creating-content-delivery-network-distribution.md) and [Content delivery network distributions](amazon-lightsail-content-delivery-network-distributions.md).

You also should have created an SSL/TLS certificate for your distribution. For more information, see [Create SSL/TLS certificates for your distribution](amazon-lightsail-create-a-distribution-certificate.md).

## View your distribution SSL/TLS certificates
<a name="view-distribution-certificates"></a>

Complete the following procedure to view your distribution SSL/TLS certificates.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Networking**.

1. Choose the name of a distribution.

   You can view all of your certificates regardless of the distribution you choose.

1. Choose the **Custom domains** tab on your distribution's management page.

1. Scroll down to the **Attached certificates** section of the page.

   All of your distribution certificates are listed under the **Attached certificates** section of the page. Expand **Validation details** to view your certificate's important dates, encryption details, identification, and validation records. Your certificates are valid for 13 months from the date you created them, after which time Lightsail attempts to automatically revalidate them. Don't delete the CNAME records that you added to your domain because they are required when your certificate is re-validated on the **Valid until** date listed.

   After you have a valid SSL/TLS certificate to use with your distribution, you should enable custom domains so that you can use the domain names of the certificate on your distribution. For more information, see [Enable custom domains for your distribution](amazon-lightsail-enabling-distribution-custom-domains.md).

# Validate SSL/TLS certificates for Lightsail distributions
<a name="amazon-lightsail-validating-a-distribution-certificate"></a>

An Amazon Lightsail SSL/TLS certificate must be validated after it's created, and before you can use it with your Lightsail distribution. After your certificate request is submitted, the status of your new certificate is changed to **Attempting to validate your certificate**. During this time, Lightsail attempts to add the certificate's validation record to the DNS of the domain names that you specified for the certificate. After a while, the status will change to **Valid**, or **Validation timed out**.

If automatic validation fails you must verify that you control all the domain names that you specified for the certificate when you created it. You do this by adding canonical name (CNAME) records to the DNS zone of each of the domains specified on the certificate. The records that you need to add are listed in the **Validation details** section of the certificate.

In this guide, we provide you with the procedure to manually validate your certificate using a Lightsail DNS zone. The procedure to validate your certificate using a different DNS hosting provider, like Domain.com or GoDaddy, may be similar. For more information about Lightsail DNS zones, see [DNS](understanding-dns-in-amazon-lightsail.md).

For more information about SSL/TLS certificates, see [SSL/TLS certificates](understanding-tls-ssl-certificates-in-lightsail-https.md).

**Contents**
+ [Prerequisite](#validate-distribution-certificate-prerequisite)
+ [Get the CNAME record values to validate your certificate](#get-distribution-certificate-cname-records)
+ [Add the CNAME records to your domain's DNS zone](#add-distribution-certificate-cname-records)
+ [View the status of your distribution certificate](#viewing-distribution-certificate-status)

## Prerequisite
<a name="validate-distribution-certificate-prerequisite"></a>

Before you get started, you need to create an SSL/TLS certificate for your distribution. For more information, see [Create SSL/TLS certificates for your distribution](amazon-lightsail-create-a-distribution-certificate.md).

## Get the CNAME record values to validate your certificate
<a name="get-distribution-certificate-cname-records"></a>

Complete the following procedure to get the CNAME records that you must add to your domains to validate the certificate.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Networking**.

1. Choose the name of the distribution for which want to get the CNAME record values of a certificate.  
![\[Networking section of the Lightsail home page.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-home-page-networking.png)

1. Choose the **Custom domains** tab on your distribution's management page.  
![\[Custom domains tab of a Lightsail distribution.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-distribution-custom-domains-tab.png)

1. Scroll down to the **Attached certificates** section of the page.

   All of your distribution certificates are listed under the **Attached certificates** section of the page, including certificates created for other Lightsail resources, and certificates that are pending validation.

1. Find the certificate that you want to validate, expand **Validation details**, and make note of the **Name** and **Value** of the CNAME records that you must add for each domain listed.

   You must add these records exactly as listed. We recommend that you copy and paste these values into a text file that you can refer to later. For more information, see the following [Add the CNAME records to your domain's DNS zone](#add-distribution-certificate-cname-records) section of this guide.

## Add the CNAME records to your domain's DNS zone
<a name="add-distribution-certificate-cname-records"></a>

Complete the following procedure to add CNAME records to your domain's DNS zone.

1. In the left navigation pane, choose **Domains & DNS**.

1. Under the **DNS zones** section of the page, choose the domain name to which you want to add the CNAME records to validate your certificate.

1. Choose the **DNS records** tab.

1. Choose **Add record** in the DNS records management page.

1. Choose **CNAME** in the **Record type** drop-down.

1. In the **Record name** text box, enter the **Name** value of the CNAME record that you got from your certificate.

   The Lightsail console pre-populates the apex portion of your domain. For example, if you want to add the `www.example.com` subdomain, then you only have to enter `www` into the text box, and Lightsail adds the `.example.com` portion for you when you save the record.

1. In the **Route traffic to** text box, enter the **Value** portion of the CNAME record that you got from your certificate.

1. Confirm that the values you entered are exactly as they were listed on the certificate that you want to validate.

1. Choose the save icon to save the record to your DNS zone.

   Repeat these steps to add additional CNAME records for domains on your certificate that need to be validated. Allow time for changes to propagate through the internet's DNS. After a few minutes, you should see if the status of your distribution certificate has changed to **Valid**. For more information, see the following [View the status of your distribution certificate](#viewing-distribution-certificate-status) section of this guide.

## View the status of your distribution certificate
<a name="viewing-distribution-certificate-status"></a>

Complete the following procedure to view the status of your SSL/TLS certificate for your distribution.

1. In the left navigation pane, choose **Networking**.

1. Choose the name of the distribution for which you want to view a certificate's status.  
![\[Networking section of the Lightsail home page.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-home-page-networking.png)

1. Choose the **Custom domains** tab on your distribution's management page.  
![\[Custom domains tab of a Lightsail distribution.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-distribution-custom-domains-tab.png)

1. Scroll down to the **Attached certificates** section of the page.

   All of your distribution certificates are listed under the **Attached certificates** section of the page, including certificates with **Pending validation** and **Valid** statuses.  
![\[Validated SSL/TLS certificate\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-validated-certificate.png)

   A **Valid** status confirms that you successfully validated your certificate with the CNAME records that you added to your domains. Choose **Details** to view your certificate's important dates, encryption details, identification, and validation records. Your certificates are valid for 13 months from the date on which you validated them, after which time Lightsail attempts to automatically re-validate them. Don't delete the CNAME records that you added to your domain because they are required when your certificate is re-validated on the **Valid until** date listed.

   After you validate your SSL/TLS certificate, you should enable custom domains for your distribution to use the domain names of your certificate on your distribution. For more information, see [Enable custom domains for your distribution](amazon-lightsail-enabling-distribution-custom-domains.md).

# Secure your Lightsail distribution with minimum TLS protocol version
<a name="amazon-lightsail-configure-distribution-tls-version"></a>

Amazon Lightsail uses SSL/TLS certificates to validate custom (registered) domains that you can use with your Lightsail distribution. This guide provides information about the viewer minimum TLS protocol versions (protocol versions) that you can configure for your SSL/TLS certificate. For more information about SSL/TLS certificates, see [SSL/TLS certificates in Lightsail](understanding-tls-ssl-certificates-in-lightsail-https.md). A viewer is an application that makes HTTP requests to the edge locations that are associated to your Lightsail distribution. For more information about distributions, see [Content delivery network distributions in Lightsail](amazon-lightsail-content-delivery-network-distributions.md).

The `TLSv1.2_2021` protocol version is configured by default when you enable custom domains for a distribution. You can configure a different protocol version, as described later in this guide. Lightsail distributions do not support custom TLS protocol versions.

## Supported protocols
<a name="load-balancer-supported-policies"></a>

Lightsail distributions can be configured with the following TLS protocols:
+ (Recommended) TLSv1.2\$12021
+ TLSv1.2\$12019
+ TLSv1.2\$12018
+ TLSv1.1\$12016

## Prerequisites
<a name="configure-distribution-tls-policy-prerequisites"></a>

Complete the following prerequisites if you haven't already:
+ [Create a Lightsail content delivery network distribution](amazon-lightsail-creating-content-delivery-network-distribution.md)
+ [Create SSL/TLS certificates for your distribution](amazon-lightsail-create-a-distribution-certificate.md)
+ [Validate SSL/TLS certificates for your distribution](amazon-lightsail-validating-a-distribution-certificate.md)
+ [Enable custom domains for your distribution](amazon-lightsail-point-domain-to-distribution.md)
+ [Point your domain to the distribution](amazon-lightsail-point-domain-to-distribution.md)

## Identify the minimum TLS protocol version for your distribution
<a name="identify-distribution-tls-policy-prerequisites"></a>

Complete the following steps to identify the minimum TLS protocol version for your Lightsail distribution

**Note**  
In this guide, you will use AWS CloudShell to perform the upgrade. CloudShell is a browser-based, pre-authenticated shell that you can launch directly from the Lightsail console. With CloudShell, you can run AWS CLI commands using your preferred shell, such as Bash, PowerShell, or Z shell. You can do this without downloading or installing command line tools. For more information about how to set up and use CloudShell, see For more information, see [AWS CloudShell in Lightsail](amazon-lightsail-cloudshell.md).

1. Open a Terminal, [AWS CloudShell](amazon-lightsail-cloudshell.md), or Command Prompt window.

1. Enter the following command to identify the minimum TLS protocol version for your Lightsail distribution.

   ```
   aws lightsail get-distributions --distribution-name DistributionName --region us-east-1 | grep "viewerMinimumTlsProtocolVersion"
   ```

   In the command, replace *DistributionName* with the name of the distribution you want to modify.

   **Example**

   ```
   aws lightsail get-distributions --distribution-name Distribution-1 --region us-east-1 | grep "viewerMinimumTlsProtocolVersion"
   ```

   The command will return the ID of the minimum TLS protocol version for your distribution.

   **Example**

   ```
   "viewerMinimumTlsProtocolVersion": "TLSv1.2_2021"
   ```

## Configure the minimum TLS protocol version using the AWS CLI
<a name="configure-distribution-tls-version-cli"></a>

Complete the following procedure to configure the TLS protocol version using the AWS Command Line Interface (AWS CLI). You do this by using the `update-distribution` command. For more information, see the [update-distribution attribute](https://docs.aws.amazon.com/cli/latest/reference/lightsail/update-distribution.html) in the *AWS CLI Command Reference*.

1. Open a Terminal, [AWS CloudShell](amazon-lightsail-cloudshell.md), or Command Prompt window.

1. Enter the following command to change the minimum TLS protocol version for your distribution.

   ```
   aws lightsail update-distribution --distribution-name DistributionName --viewer-minimum-tls-protocol-version ProtocolVersion
   ```

   In the command, replace the following example text with your own:
   + *DistributionName* with the name of the distribution that you want to update.
   + *ProtocolVersion* with the valid TLS protocol version. For example `TLSv1.2_2021` or `TLSv1.2_2019`.

   Example:

   ```
   aws lightsail update-distribution --distribution-name  MyDistribution --viewer-minimum-tls-protocol-version TLSv1.2_2021
   ```

   Your change takes a few moments to become effective.

# Delete unused SSL/TLS certificates from Lightsail distributions
<a name="amazon-lightsail-deleting-distribution-certificates"></a>

**Warning**  
Deleting an SSL/TLS certificate is final and can't be undone.

You can delete Amazon Lightsail SSL/TLS certificates that you're no longer using on your distributions. For example, your certificate might be expired and you've already attached an updated certificate that's validated. For more information about certificates, see [SSL/TLS certificates](understanding-tls-ssl-certificates-in-lightsail-https.md). For more information about distributions, see [Content delivery network distributions](amazon-lightsail-content-delivery-network-distributions.md).

You have a quota of certificates that you can create over a 365-day period. For more information, see [Lightsail service quotas](https://docs.aws.amazon.com/general/latest/gr/lightsail.html#limits_lightsail) in the *AWS General Reference*.

## Delete an SSL/TLS certificate for your distribution
<a name="deleting-distribution-certificate"></a>

**Important**  
The **Delete** option is unavailable if the certificate you want to delete is in use. To delete certificates that are in use, you must first change the custom domains of the distribution that are using the certificate, or disable custom domains on the distribution that are using the certificate.

Complete the following procedure to delete an SSL/TLS certificate for your distribution.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Networking**.

1. Choose the name of the distribution from which you want to delete the SSL/TLS certificate. If the certificate is not currently in use, then you can choose any distribution because all of your certificates are listed in every distribution.

1. Choose the **Custom domains** tab on your distribution's management page.

1. In the **Certificates** section of the page, choose the ellipsis icon (⋮) for the certificate that you want to delete, and choose **Delete**.

   The **Delete** option is unavailable if the certificate you want to delete is in use. To delete certificates that are in use, you need to first change the custom domains of the distribution that is using the certificate, or disable custom domains on the distribution that is using the certificate. For more information, see [Change custom domains for your distribution](amazon-lightsail-changing-distribution-custom-domains.md) and [Enable custom domains for your distribution](amazon-lightsail-disabling-distribution-custom-domains.md#amazon-lightsail-disabling-distribution-custom-domains.title).

1. Choose **Yes, delete** to confirm the deletion.