note

This page contains my notes on AWS glacier CLI.

AWS setup

aws configure

Create a vault

aws glacier create-vault --account-id - --vault-name Photos

Upload a file

Create an archive, a file in the vault.

Then compute its digest with openssl.

openssl dgst -sha256 $FILENAME

Then the file can be uploaded:

aws glacier upload-archive \
    --account-id - \
    --vault-name $VAULTNAME \
    --checksum $CHECKSUM \
    --body $FILENAME \
    --archive-description "XXX"

TODO Multi-chunks upload

When the archive is big, more than XXX, the file must be split.

split ...

Get The list of archives in vault

aws glacier initiate-job  --account-id - --vault-name Photos --job-parameters '{"Type": "inventory-retrieval"}'
{
    "jobId": "FMv8wdcihQ-eTFxBP8DSyjkr4I1-oyjOPRNnehFpFv_wTkb9extLFoCzX1v0erJFwB40nj0Hml3qdTw0szqYJ0s1Eln0",
    "location": "/986072598122/vaults/Photos/jobs/FMv8wdcihQ-eTFxBP8DSyjkr4I1-oyjOPRNnehFpFv_wTkb9extLFoCzX1v0erJFwB40nj0Hml3qdTw0szqYJ0s1Eln0"
}

get the status of a initiated job

aws glacier list-jobs --account-id - --vault-name Photos
{
    "JobList": [
        {
            "Action": "InventoryRetrieval",
            "CreationDate": "2017-12-30T18:38:41.400Z",
            "Completed": false,
            "StatusCode": "InProgress",
            "InventoryRetrievalParameters": {
                "Format": "JSON"
            },
            "VaultARN": "arn:aws:glacier:eu-central-1:986072598122:vaults/Photos",
            "JobId": "FMv8wdcihQ-eTFxBP8DSyjkr4I1-oyjOPRNnehFpFv_wTkb9extLFoCzX1v0erJFwB40nj0Hml3qdTw0szqYJ0s1Eln0"
        }
    ]
}

get the result of the initiated job

aws glacier get-job-output --account-id - --vault-name Photos --job-id $JOB_ID outfile test.json

About me

Stuff I do with my brain, my fingers and an editor:

(Front-end) development - typescript, Vue, React, svelte(kit) web architectures web performance API design pragmatic SEO security Accessibility (A11y) front-end dev recruitment and probably more...

Feel free to , check out my open source projects, or just read the things I write on this site.