Zenitram.PRO
Zenitram.PRO

Reputation: 139

How to delete aws s3 bucket in aws cli

I have the ff s3 bucket, see image below: enter image description here

I know how to delete them on the page but how can i delete them using aws cli?

I tried using

aws s3api delete-objects --bucket elasticbeanstalk-ap-southeast-1-613285248276

but it wont work.

Upvotes: 9

Views: 16386

Answers (3)

Alok G.
Alok G.

Reputation: 1538

I am deleting S3 bucket from following command without any extra hustle of emptying it first

aws s3 rb s3://<BUCKATE-NAME> --force

for example

aws s3 rb s3://alok.guha.myversioningbucket --force

PS : Make sure you have programmatic access with policy "AmazonS3FullAccess"

Upvotes: 2

Krishna Prasad
Krishna Prasad

Reputation: 11

The following commands deletes the Bucket from S3

aws s3api delete-bucket --bucket "your-bucket-name" --region "your-region".

Upvotes: 1

Arafat Nalkhande
Arafat Nalkhande

Reputation: 11708

You can use 'rb' option

E.g. aws s3 rb s3://elasticbeanstalk-ap-southeast-1-613285248276

For more details click here

If the bucket is not empty then use the --force flag

Upvotes: 21

Related Questions