Configuring Vault Notifications Using the Amazon Command Line Interface - Amazon S3 Glacier
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

This page is only for existing customers of the S3 Glacier service using Vaults and the original REST API from 2012.

If you're looking for archival storage solutions we suggest using the S3 Glacier storage classes in Amazon S3, S3 Glacier Instant Retrieval, S3 Glacier Flexible Retrieval, and S3 Glacier Deep Archive. To learn more about these storage options, see S3 Glacier storage classes and Long-term data storage using S3 Glacier storage classes in the Amazon S3 User Guide. These storage classes use the Amazon S3 API, are available in all regions, and can be managed within the Amazon S3 console. They offer features like Storage Cost Analysis, Storage Lens, advanced optional encryption features, and more.

Configuring Vault Notifications Using the Amazon Command Line Interface

This section describes how to configure vault notifications using the Amazon Command Line Interface. When you configure notifications, you specify job completion events that trigger notification to an Amazon Simple Notification Service (Amazon SNS) topic. In addition to configuring notifications for the vault, you can also specify a topic to publish notification to when you initiate a job. If your vault is configured to notify for a specific event and you specify notification in the job initiation request, then two notifications are sent.

Follow these steps to configure vault notification using the Amazon CLI.

(Prerequisite) Setting Up the Amazon CLI

  1. Download and configure the Amazon CLI. For instructions, see the following topics in the Amazon Command Line Interface User Guide:

    Installing the Amazon Command Line Interface

    Configuring the Amazon Command Line Interface

  2. Verify your Amazon CLI setup by entering the following commands at the command prompt. These commands don't provide credentials explicitly, so the credentials of the default profile are used.

    • Try using the help command.

      aws help
    • To get a list of S3 Glacier vaults on the configured account, use the list-vaults command. Replace 123456789012 with your Amazon Web Services account ID.

      aws glacier list-vaults --account-id 123456789012
    • To see the current configuration data for the Amazon CLI, use the aws configure list command.

      aws configure list

Example: Configure Vault Notifications Using the Amazon CLI

  1. Use the set-vault-notifications command to configure notifications that will be sent when specific events happen to a vault. By default, you don't get any notifications.

    aws glacier set-vault-notifications --vault-name examplevault --account-id 111122223333 --vault-notification-config file://notificationconfig.json
  2. The notification configuration is a JSON document as shown in the following example.

    { "SNSTopic": "arn:aws:sns:us-west-2:012345678901:mytopic", "Events": ["ArchiveRetrievalCompleted", "InventoryRetrievalCompleted"] }

    For more information about using Amazon SNS topics for S3 Glacier see, Configuring Vault Notifications in S3 Glacier: General Concepts

    For more information about Amazon SNS, see Getting Started with Amazon SNS.