Deleting a distribution - Amazon CloudFront

Deleting a distribution

If you no longer want to use a distribution, you can delete it by using the CloudFront console or by using the CloudFront API.

Be aware that before you can delete a distribution, you must disable it, which requires permission to update the distribution.

If you need to delete a distribution with an OAC attached to an S3 bucket, see Deleting a distribution with an OAC attached to an S3 bucket for important details.

Note

If you disable a distribution that has an alternate domain name associated with it, CloudFront stops accepting traffic for that domain name (such as www.example.com), even if another distribution has an alternate domain name with a wildcard (*) that matches the same domain (such as *.example.com).

To delete a CloudFront distribution
  1. Sign in to the AWS Management Console and open the CloudFront console at https://console.aws.amazon.com/cloudfront/v4/home.

  2. In the right pane of the CloudFront console, find the distribution that you want to delete.

    • If the Status column shows Disabled, skip to Step 6.

    • If the Status shows Enabled but the distribution still shows Deploying in the Last modified column, wait for deployment to finish before continuing to step 3.

  3. In the right pane of the CloudFront console, select the check box for the distribution that you want to delete.

  4. Choose Disable to disable the distribution, and choose Yes, Disable to confirm. Then choose Close.

    Note

    Because CloudFront must propagate this change to all edge locations, it might take a few minutes before the update is complete and you can delete your distribution.

  5. The value of the Status column immediately changes to Disabled. Wait until the new timestamp appears under the Last modified column.

  6. Select the check box for the distribution that you want to delete.

  7. Choose Delete, Delete.

    Note

    If you have just marked your distribution as disabled, CloudFront might still need a few more minutes to propagate that change to the edge locations. Until propagation is complete, the Delete option isn't available.

You can also delete a distribution using the CloudFront API. For more information, see DeleteDistribution in the Amazon CloudFront API Reference.