Cleaning up your example resources - Amazon Simple Storage Service

Cleaning up your example resources

If you created your static website as a learning exercise, you should delete the AWS resources that you allocated so that you no longer accrue charges. After you delete your AWS resources, your website is no longer available.

Step 1: Delete the Amazon CloudFront distribution

Before you delete an Amazon CloudFront distribution, you must disable it. A disabled distribution is no longer functional and does not accrue charges. You can enable a disabled distribution at any time. After you delete a disabled distribution, it is no longer available.

To disable and delete a CloudFront distribution
  1. Open the CloudFront console at https://console.aws.amazon.com/cloudfront/v4/home.

  2. Select the distribution that you want to disable, and then choose Disable.

  3. When prompted for confirmation, choose Yes, Disable.

  4. Select the disabled distribution, and then choose Delete.

  5. When prompted for confirmation, choose Yes, Delete.

Step 2: Delete the Route 53 hosted zone

Before you delete the hosted zone, you must delete the record sets that you created. You don't need to delete the NS and SOA records; these are automatically deleted when you delete the hosted zone.

To delete the record sets
  1. Open the Route 53 console at https://console.aws.amazon.com/route53/.

  2. In the list of domain names, select your domain name, and then choose Go to Record Sets.

  3. In the list of record sets, select the A records that you created.

    The type of each record set is listed in the Type column.

  4. Choose Delete Record Set.

  5. When prompted for confirmation, choose Confirm.

To delete a Route 53 hosted zone
  1. Continuing from the previous procedure, choose Back to Hosted Zones.

  2. Select your domain name, and then choose Delete Hosted Zone.

  3. When prompted for confirmation, choose Confirm.

Step 3: Disable logging and delete your S3 bucket

Before you delete your S3 bucket, make sure that logging is disabled for the bucket. Otherwise, AWS continues to write logs to your bucket as you delete it.

To disable logging for a bucket
  1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. Under Buckets, choose your bucket name, and then choose Properties.

  3. From Properties, choose Logging.

  4. Clear the Enabled check box.

  5. Choose Save.

Now, you can delete your bucket. For more information, see Deleting a bucket.