Ad space (banner)
AD

Got the fundamentals? A structured AWS course is a fast way to level up.

Find AWS courses on Udemy

Affiliate link. Costs you nothing extra.

☁️AWS Lessons
Lesson 22 / 41

Deleting a Bucket with aws s3 rb

When a bucket has outlived its purpose, use aws s3 rb. Short for "remove bucket," it deletes an empty bucket.

The syntax is aws s3 rb s3://bucket-name. The bucket must be empty, unless you add --force.

Running aws s3 rb s3://my-bucket on a bucket that still holds objects fails with BucketNotEmpty — empty it first, then remove it.

A common stumble is reaching for --force immediately and deleting contents you meant to keep. Look at what's inside before forcing.

In real work, tidying up unused buckets keeps both the console and the bill manageable.

AWS
Try it (type this into the pseudo terminal)
aws s3 rb s3://my-bucket

🧑‍💻 You can type this command into the AWS pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)