Some time ago I had to delete now deprecated Amazon Glacier vault containing a lot of old archives. Deleting Amazon Glacier vault was a bit more involved than just one click. There was no need to save the archived data in this case.
Prepare that the whole process will take more than one working day. Since you cannot delete a vault which is not empty, the first thing is to delete all archives within the vault. Oh, and there is no “Empty vault” button like in S3… And nothing happens in realtime, but through background jobs. Steps needed below.
1. Request new inventory retrieval job
Request new retrieval job:
aws glacier initiate-job \
--account-id - \
--vault-name archive \
--job-parameters '{"Type": "inventory-retrieval"}'
# Will return the job ID
{
"location": "/123456789012/vaults/archive/jobs/...",
"jobId": "..."
}
2. Check job status
Now that you have the job ID, you can query the job status:
aws glacier describe-job \
--account-id - \
--vault-name archive \
--job-id "..."
# Which returns:
{
"JobId": "...",
"Action": "InventoryRetrieval",
"VaultARN": "arn:aws:glacier:eu-west-1:123456789012:vaults/archive",
"CreationDate": "2026-02-04T08:42:12.138Z",
"Completed": false,
"StatusCode": "InProgress",
"InventoryRetrievalParameters": {
"Format": "JSON"
}
}
# And (much) later, when the job is ready:
{
"JobId": "...",
"Action": "InventoryRetrieval",
"VaultARN": "arn:aws:glacier:eu-west-1:123456789012:vaults/archive",
"CreationDate": "2026-02-04T08:42:12.138Z",
"Completed": true,
"StatusCode": "Succeeded",
"StatusMessage": "Succeeded",
"InventorySizeInBytes": 2145659,
"CompletionDate": "2026-02-04T12:26:49.115Z",
"InventoryRetrievalParameters": {
"Format": "JSON"
}
}
3. Download the inventory
Now that we have a job, we can retrieve the inventory:
aws glacier get-job-output \
--account-id - \
--vault-name archive \
--job-id "..." output.json
This will produce a huge JSON file, if there are lot of archives.
4. Delete each archive
Now we need to iterate this JSON data, and filter the necessary information with e.g. jq and based on this data request Glacier to delete each archive:
for id in $(jq -r '.ArchiveList[].ArchiveId' output.json); do
echo "Deleting archive $id"
aws glacier delete-archive \
--account-id - \
--vault-name archive \
--archive-id="$id"
done
5. Verify the vault is empty
Depending on amount of archives, this can take long time. Let it run at least over night. Check that the vault is empty:
aws glacier describe-vault \
--account-id - \
--vault-name konserni-archive
{
"VaultARN": "arn:aws:glacier:eu-west-1:123456789012:vaults/archive",
"VaultName": "archive",
"CreationDate": "2018-03-29T21:58:41.950Z",
"LastInventoryDate": "2026-02-04T22:37:24.531Z",
"NumberOfArchives": 0,
"SizeInBytes": 0
}
6. Delete the vault
And finally now that the vault is empty, it can be deleted:
aws glacier delete-vault \
--account-id - \
--vault-name archive
And that’s it!