Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chieforz/clear-aws-glacier

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chieforz/clear-aws-glacier

Follow these steps to clear all archives from an AWS glacier vault. After this is finished, you will be able to delete the vault itself through the browser console.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

AWS Glacier: Clear vault

Follow these steps to clear all archives from an AWS glacier vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME

This can take hours or even days, depending on the size of the vault. Use the following command to check if it is ready:

aws glacier list-jobs --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME

Copy the JobId (including the quotes) for the next step.

(Alternative Step / Set Job Notification)

If you do not want to check your job status continously, you can create a notification to receive a email when your job is finished. Configuring Vault Notifications Using the AWS Command Line Interface

aws glacier set-vault-notifications --account-id YOUR_ACCOUNT_ID --vault-name YOUR_VAULT_NAME --vault-notification-config ~/notificationconfig.json

Or you enable it via the aws console: Configuring Vault Notifications by Using the S3 Glacier Console

Step 2 / Get the ArchivesIds

The following command will result in a file listing all archive IDs, required for step 3.

$ aws glacier get-job-output --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME --job-id YOUR_JOB_ID ./job-output.json

Step 3 / Delete archives

Set the following parameters through environment variables:

export AWS_ACCOUNT_ID=YOUR_ACCOUNT_ID
export AWS_VAULT_NAME=YOUR_VAULT_NAME

And run the script via npx/pnpx:

npx @chieforz/clear-aws-glacier ./archive-log.json

pnpx @chieforz/clear-aws-glacier ./archive-log.json

All additional parameters will be passed to the aws cli sdk: Command line options

For debugging you can pass --verbose to disable the progress bar.

Acknowledgement

This tutorial is based on: https://gist.github.com/Remiii/507f500b5c4e801e4ddc icon

Keywords

FAQs

Package last updated on 09 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc