download free 30 days trial version buy bucket explorer
Documentation  Download  Purchase  Support  FAQs   Forum   ScreenShots & Demos

CloudFront- How to Delete Public Distribution (DELETE Distribution)?

If you no longer need your data to be accessed via CloudFront, then you can delete the Distribution . In one AWS account you can create upto 100 distribution, to create more than 100, you must delete existing distribution. For deleting a Public Download Distribution, it must be disabled. If your distribution is disabled you can delete it from CloudFront.

You can delete a Public Download distribution, by sending HTTP GET Distribution Config, PUT Distribution Config and DELETE Distribution Requests to CloudFront, in one of the two ways explained below:

  1. Delete Public Download distribution using REST API - "GET Distribution Config, PUT Distribution Config and DELETE Distribution" : To delete Public Download Distribution, you will need to wrote your own code to delete Public Download distribution using GET Distribution Config, PUT Distribution Config and DELETE Distribution REST APIs.
  2. Delete Public Download distribution using Bucket Explorer : To avoid writing multiple lines of code, you can delete Public Download distribution with Bucket Explorer in just few mouse clicks.

 

1. Delete Public Download Distribution using CloudFront API - PUT Distribution Config, GET Distribution Config and DELETE Distribution

To delete the Public distribution you need to follow these steps -

  1. Submit a GET Distribution Config request to get the current configuration and the Etag header for the distribution similar to what we did in update distribution.
  2. Update the XML document returned in the response to GET Streaming Distribution Config with value of Enabled to false.
  3. Submit a PUT Distribution Config request to update the distribution.
  4. As the Status is Deployed, submit a DELETE Distribution request to delete.

DELETE Distribution Request
Syntax:


DELETE/2012-07-01/distribution/ distribution ID HTTP/1.1
Host: cloudfront.amazonaws.com
If-Match: value from ETag header in previous GET or PUT response
Authorization: AWS authentication string
Date: time stamp
Other required headers
 

2. Delete Public Download Distribution using Bucket Explorer


Follow these steps to delete a Public distribution using Bucket Explorer:

  1. Run Bucket Explorer.
  2. Choose "Distribution" icon from Bucket table toolbar or you can do the same by right clicking on any bucket and then click on "Manage Distribution" option.
  3. It displays a window having list of already created distributions.
  4. To delete distribution, select a particular distribution from List distribution table and click on "Delete" icon from toolbar of List distribution window.
  5. It opens a new window to delete distribution, which shows information like domain name, bucket name, Enabled/Disabled, CNAME and Comment associated with that distribution.
  6. Now click on "Delete" button to delete distribution.
  1. If you are trying to delete distribution which is enabled, then you will get a message as "Distribution needs to be disabled. You can disable the distribution by un-checking ‘Enable Distribution’ option".
    • Delete button toggles with "Update" button. Clicking on which, can disable that distribution.
    • After updating distribution you need to wait till distribution gets status "Deployed" in place of "In Progress".
    • When you get status "Deployed", you can delete this distribution using step 4.
    • You can also use update feature to disable distribution.