I am unable to delete a bucket with 160million+ versions that were created by a bug that was updating a profile picture and since we had versioning set up it caused a heap of a mess. I tried to use the AWS website to delete the versions and delete the s3 bucket but the auth token expires before it runs through all the files and signs me out of AWS. I then tried to use AWS CLI and am confronted with another issue. The command and error can be found below.
aws s3api delete-bucket --bucket pinch-profile-picture --region us-east-2
and received the following error:
An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty. You must delete all versions in the bucket.
AWS does not want to touch or delete the bucket for us because they would be held liable for deleting something.
The following steps I might be able to take are:
1)Create a script to delete everything.
2)Figure out how to delete all the versions from CLI
3)Figure out how to not prevent our token from expiring on the site
4)"Insert your suggestion here"
..
99)manually delete but this is limited to 300 per page which would mean i would be required to delete 300 items 666,666 times if we created 200million versions. So thats a no-go.
But I am open to suggestions, what are your tips to getting the S3 bucket deleted along with the versions. If you've been in the situation before or have experience building scripts please help a brotha out.
Best Regards,
Akshay Kumar