There are more AWS SDK examples available in the AWS Doc SDK Examples
Use SetVaultNotifications
with an AWS SDK or CLI
The following code examples show how to use SetVaultNotifications
.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:
- AWS CLI
-
The following command configures SNS notifications for a vault named
my-vault
:aws glacier set
-
vault-notifications --account-id - --vault-namemy-vault
--vault-notification-configfile://notificationconfig.json
notificationconfig.json
is a JSON file in the current folder that specifies an SNS topic and the events to publish:{ "SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-vault", "Events": ["ArchiveRetrievalCompleted", "InventoryRetrievalCompleted"] }
Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
-
For API details, see SetVaultNotifications
in AWS CLI Command Reference.
-