Created
October 17, 2023 08:39
-
-
Save dasgoll/5599435741eb95243d9b05c81725d68a to your computer and use it in GitHub Desktop.
force delete S3 bucket in aws
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export AWS_PROFILE=k2k | |
bucket_name="k2k-dev-vpc-flow-logs-s3serverlogs" | |
aws s3api put-bucket-versioning --bucket ${bucket_name} --versioning-configuration Status=Enabled --region eu-central-1 | |
delete-bucket -p k2k -f -b ${bucket_name} -r eu-central-1 ; aws s3 rm s3://${bucket_name} --region eu-central-1 | |
An error occurred (NoSuchBucket) when calling the PutBucketVersioning operation: The specified bucket does not exist | |
➡️ Disabling Bucket Versioning if enabled | |
➡️ Collecting objects to delete | |
Error deleting bucket: NoSuchBucket | |
fatal error: An error occurred (NoSuchBucket) when calling the ListObjectsV2 operation: The specified bucket does not exist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment