Category: AWS
The steps outlined here use the AWS CLI.
Delete an object from a bucket where the s3 url is in the format of s3://$bucket-name/$file-name
as follows:
aws s3 rm s3://backup-bucket-test-orbiks-com/my-test-file
You cannot delete a versioning enabled bucket using the AWS CLI. You must remove all of the objects first.
Delete an empty, non-versioned bucket called backup-bucket-test-orbiks-com
with the following command:
aws s3 rb s3://backup-bucket-test-orbiks-com
Force delete a non-empty, non-versioned bucket called backup-bucket-test-orbiks-com
with the following command:
aws s3 rb s3://backup-bucket-test-orbiks-com --force
Note: If you delete a bucket, another AWS account or user will be able claim the bucket name. If you want to continue to use the same bucket name, empty the bucket without deleting it.