Categories
Computers

AWS Glacier Delete All Archives in Vault

Ran into an annoying issue where I wanted to delete an old AWS Glacier Vault, but AWS won’t let you delete a Vault and all containing archives, instead you must first delete all archives and only then can you delete the vault.

AFAIK there isn’t anything in the AWS CLI tools to accomplish this and couldn’t find any lightweight tools, so hashed together a small python script to do the job.

The script reads the json output file (output.json) you can generate for a vault which contains a list of all the archives in that particular vault (can’t remember the exact AWS CLI command to do this) and then goes through and simply deletes the archives one by one. After a few hours have passed the vault should be empty and can be deleted.

Script can be found here: https://github.com/bytesandbolts/delete-aws-glacier-archives

Leave a Reply

Your email address will not be published. Required fields are marked *