Skip to content

Instantly share code, notes, and snippets.

@darrenrogan
Created October 16, 2018 22:54
Show Gist options
  • Save darrenrogan/0e322a8e131c3144895f6c5927ea5791 to your computer and use it in GitHub Desktop.
Save darrenrogan/0e322a8e131c3144895f6c5927ea5791 to your computer and use it in GitHub Desktop.
AWS CLI to remove delete markers (to enable the deletion of the S3 bucket)
aws s3api delete-objects --bucket bucket-name --delete "$(aws s3api list-object-versions --bucket "bucket_name" --output=json --query='{Objects: DeleteMarkers[].{Key:Key,VersionId:VersionId}}')"
@darrenrogan
Copy link
Author

aws s3 rm s3://bucket-name --recursive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment