Get started with Amazon S3 Glacier Vault Lock

Amazon S3 Glacier Vault Lock is a feature provided by AWS (Amazon Web Services) for its S3 Glacier service, which is a secure, durable, and low-cost cloud storage solution for data archiving and long-term backup.

The Vault Lock feature allows you to easily deploy and enforce compliance controls on individual S3 Glacier vaults with a vault lock policy. Once this policy is locked, it cannot be changed, ensuring that the compliance controls are enforced and your data remains immutable for the duration of the retention period defined in the policy. You can specify controls such as "write once read many" (WORM) in a Vault Lock policy and lock the policy from future edits. For more information about Vault Lock policies, see Vault Lock Policies.

Use cases for Amazon S3 Glacier Vault Lock include:

  1. Regulatory Compliance: Many industries are subject to regulations that require certain types of data to be retained for a fixed period of time in an unalterable state. Vault Lock helps in complying with such regulations, like SEC Rule 17a-4 for the financial services industry, which requires records to be preserved in a non-rewriteable and non-erasable format.

  2. Data Archiving: For organizations that need to archive sensitive or critical data for long periods, Vault Lock ensures that this data cannot be tampered with or deleted until the end of the specified retention period.

  3. Legal Hold: In legal cases, certain data might need to be preserved in its current state as part of a legal hold requirement. Vault Lock ensures that this data is immutable and can be presented as evidence in its original form.

  4. Protecting Intellectual Property: Companies can use Vault Lock to protect their intellectual property by ensuring that original content, such as creative works or research data, remains unchanged.

  5. Long-term Data Retention: For long-term data retention strategies, especially in fields like scientific research or historical archiving, where data integrity over many years is crucial, Vault Lock provides a secure way to store data without the risk of it being altered or deleted.

Amazon S3 Glacier Vault Lock is an essential tool for businesses and organizations that need to ensure the integrity and immutability of their archived data for compliance, legal, intellectual property protection, or long-term preservation purposes.

Difference between Vault Lock Policy and Vault Access Policy

Amazon S3 Glacier Vault Lock and Vault Access Policy are both important features for managing data security and access in AWS, but they serve different purposes and operate in distinct ways:

  1. Vault Lock Policy:

    • Purpose: The Vault Lock Policy is designed for enforcing compliance and regulatory requirements. It's used to set immutable data retention policies on a Glacier vault.

    • Immutability: Once a Vault Lock Policy is finalized, it cannot be changed or deleted until the specified retention period is over. This ensures that the data stored in the vault remains unaltered and undeletable, complying with various regulatory standards.

    • Use Cases: This is particularly useful for industries with strict regulatory requirements regarding data retention, like finance or healthcare, where data must be stored in a non-rewriteable and non-erasable format for a specific period.

  2. Vault Access Policy:

    • Purpose: The Vault Access Policy is focused on controlling who can access the data stored in the Glacier vault. It's a set of permissions that determine what actions users and groups can perform on the vault.

    • Flexibility: Unlike the Vault Lock Policy, the Vault Access Policy can be changed at any time. This allows for dynamic control over who has access to the vault and what actions they can perform, such as uploading or downloading data.

    • Use Cases: It's used for day-to-day access management, like granting different levels of access to various users or groups, depending on their role or requirements in an organization.

The Vault Lock Policy is about enforcing immutability and compliance over the stored data, ensuring that it remains untouched for a set period. In contrast, the Vault Access Policy is about controlling access to the vault, specifying who can interact with the data and how. Both policies complement each other in providing comprehensive security and compliance management for data stored in Amazon S3 Glacier. You can use Vault lock and vault access policies together. For example, you can implement time-based data-retention rules in the Vault Lock policy (deny deletes), and grant read access to designated third parties or your business partners (allow reads) in your vault access policy.

Tutorial: Set up Vault Lock Policy by using AWS CLI

Setting up a Vault Lock policy in Amazon S3 Glacier using the AWS Command Line Interface (CLI) involves several steps. Before proceeding, ensure you have the AWS CLI installed and configured with the necessary access permissions. Here's a step-by-step guide:

1. Create a Glacier Vault

If you haven't already created a vault, do so by using the following command:

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

Replace YourVaultName with your desired vault name.

2. Create a Vault Lock Policy

Write a JSON file with your lock policy. Here's a sample policy (save this as lock-policy.json). Before using this command, replace the VAULT_ARN and Principal with the appropriate values for your use case.

To find the ARN of the vault you wish to lock, you can use the list-vaults command.


Replace Region, AccountId, and YourVaultName with your AWS region, account ID, and vault name, respectively. Adjust the ArchiveAgeInDays value as needed.

3. Initiate the Vault Lock

Use the AWS CLI to initiate the lock on your vault:

aws glacier initiate-vault-lock --account-id - --vault-name YourVaultName --policy file://lock-policy.json

This command will return a lockId, which you'll need for the next steps.

4. Complete the Vault Lock

Before finalizing the Vault Lock, make sure your policy is correct as you won't be able to change it afterward. To complete the lock within 24 hours else the vault lock policy is removed from the vault, use:

aws glacier complete-vault-lock --account-id - --vault-name YourVaultName --lock-id YourLockId

Replace YourLockId with the lock ID obtained from the previous step.

5. Verify the Vault Lock

To ensure that the Vault Lock policy has been applied, you can check the policy:

aws glacier get-vault-lock --account-id - --vault-name YourVaultName

Important Notes:

  • Make sure you fully understand the policy you are applying. Once the Vault Lock is in place, it cannot be altered or removed until the specified period expires.

  • Ensure your AWS CLI is configured with the necessary permissions to perform these actions.

  • The --account-id - parameter uses a hyphen (-) to represent the current account. If you're performing this on behalf of another account, replace it with the specific account ID.

This tutorial provides a basic example of setting up a Vault Lock policy. Depending on your specific requirements, you may need to customize the policy further.


  1. S3 Glacier Vault Lock

  2. Locking a Vault using the AWS Command Line Interface

  3. Vault Lock Policies



  6. Get started with Amazon S3 Glacier

  7. Vault Access Policy