How to delete AWS S3 bucket?

Learn more on AWS S3:

Let’s start:

You can delete an empty Amazon S3 bucket. Before deleting a bucket, consider the following:

  • Bucket names are unique. If you delete a bucket, another AWS user can use the name.

  • If the bucket hosts a static website, and you created and configured an Amazon Route 53 hosted zone, then you must clean up the Route 53 hosted zone settings that are related to the bucket.

  • If the bucket receives log data from Elastic Load Balancing (ELB): We recommend that you stop the delivery of ELB logs to the bucket before deleting it.
  • After you delete the bucket, if another user creates a bucket using the same name, your log data could potentially be delivered to that bucket.

So, now let’s start to delete the S3 Bucket.

Step1: Select the Bucket

  • Go to the Buckets list page
  • Select the bucket name, that you want to delete
  • Click on Delete button

select-bucket-name

Step2: Fix the Error

  • When you click the Delete, then it will thrown error if bucket is not empty.
  • So make sure the Bucket is empty before deleting it.

delete-bucket-error

Step3: Delete bucket objects

  • Go back to the bucket and select all the objects
  • Click Delete button

delete-bucket-objects

Step4: Confirm Object Delete Dialog

  • Confirm the confirm delete dialog
  • Just type permanently delete on the field
  • Click Delete Objects

confirm-object-deletion

Step5: Object Deletion Message

** After successfully deleting objects, It’ll show the success message

object-deletion-message

Step6: Repeat step1.

  • Now bucket is Empty.
  • You can repeat the Step1 to delete the bucket.
  • Here, I’m assuming we have not configured any statis website or Route 53 hosted zone
  • After selecting the bucket, click on Delete

select-bucket-name

Step7: Confirm Object Deletion Dialog

  • Now confirm the dialog.
  • Just type bucket name skillshats-s3-bucket in the field.
  • Click on the Delete Bucket

confirm-bucket-deletion.png

Step8: Success Message

  • After deleting the bucket, It’ll show the success message.
  • Now if you want to create another bucket, then click on Create Bucket.

bucket-deletion-message.png

If you are unable to delete an Amazon S3 bucket, consider the following:

  • Make sure the bucket is empty – You can only delete buckets that don’t have any objects in them. Make sure the bucket is empty.

  • s3:DeleteBucket permissions – If you cannot delete a bucket, work with your IAM administrator to confirm that you have s3:DeleteBucket permissions in your IAM user policy. For information about how to view or update IAM permissions, see Changing permissions for an IAM user in the IAM User Guide.

  • s3:DeleteBucket deny statement – If you have s3:DeleteBucket permissions in your IAM policy and you cannot delete a bucket, the bucket policy might include a deny statement for s3:DeleteBucket. Buckets created by ElasticBeanstalk have a policy containing this statement by default. Before you can delete the bucket, you must delete this statement or the bucket policy.

Congratulation!!
You have successfully deleted the S3 Bucket.


Learn more on AWS S3:

Explore More AWS Posts

  • AWS
  • 3 min read
Mastering Boto3: The AWS SDK for Python - Tips and Tricks

Learn how to use Boto3, the AWS SDK for Python, to interact with AWS services. From clients to resources to wrappers, tips and examples to boost your…

Read More
  • AWS
  • 11 min read
Optimizing Boto3: Wrapping AWS SDK for Python for Better Performance

Learn how to wrap Boto3, the AWS SDK for Python, to optimize performance and add custom functionality. Tips, examples and best practices to boost you…

Read More
  • AWS
  • 6 min read
Streamline CAS Enrollment with CloudFormation and boto3: A Comprehensive Guide

Get a comprehensive guide on how to streamline CAS enrollment with AWS CloudFormation & boto3, automate resource provisioning and manage permissions …

Read More
  • AWS
  • 8 min read
AWS CloudFormation and boto3: The ultimate guide to enrolling in CAS and checking permissions

Learn how to automate CAS enrollment with AWS CloudFormation and check permissions using boto3 for efficient resource provisioning and management.

Read More
  • AWS
  • 2 min read
View the S3 Bucket Object

A newly created bucket is always private by default and all objects belonging to the bucket is private.

Read More
  • AWS
  • 1 min read
How to upload an object on AWS S3 Bucket?

Click on the bucket name link to navigate inside the bucket. Once inside, you can upload your file.

Read More