1
votes

How is an archive downloaded from Glacier using AWS CLI?
I've tried:

aws glacier initiate-job --vault-name test --account-id - --job-parameters '{"Type": "archive-retrieval", "ArchiveId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}'  

and I get the following error:

A client error (PolicyEnforcedException) occurred when calling the InitiateJob operation: InitiateJob request denied by current data retrieval policy.

I imagined this would be similar to the inventory-retrieval operation, like send the request now and 5 hours later run the command again to download it.

3

3 Answers

1
votes

You need to add "glacier:InitiateJob" as an allowed action in your policy document.

Go to your Web UI, click on Glacier and then click on your Vault. Click on Permissions and then on Edit policy document. Here you add the "glacier:InitiateJob" line under a field called "Action": [

1
votes

I had the same error when my "Data Retrieval Policy" was "Free Tier Only".

2 ways:

1) Limit your downloading:

Read this https://aws.amazon.com/glacier/faqs/#How_much_data_can_I_retrieve_for_free . In two words: each day you can retrieve for free about 0.17% of your data stored.

2) Pay for your downloading:

You should change it using web interface: "Amazon Glacier Vaults" page -> Settings; or using aws cli: see set-data-retrieval-policy https://docs.aws.amazon.com/cli/latest/reference/glacier/set-data-retrieval-policy.html

0
votes

For anyone that was stuck like me:

If your job completed successfully and you don't know what to do, use get-job-output.