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
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.
Step3: Delete bucket objects
- Go back to the bucket and select all the objects
- Click Delete button
Step4: Confirm Object Delete Dialog
- Confirm the confirm delete dialog
- Just type permanently delete on the field
- Click Delete Objects
Step5: Object Deletion Message
** After successfully deleting objects, It’ll show the success 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
Step7: Confirm Object Deletion Dialog
- Now confirm the dialog.
- Just type bucket name skillshats-s3-bucket in the field.
- Click on the Delete Bucket
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.
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 fors3: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: