Logging Amazon S3 Glacier API Calls with Amazon CloudTrail - 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.

Logging Amazon S3 Glacier API Calls with Amazon CloudTrail

Amazon S3 Glacier (S3 Glacier) is integrated with Amazon CloudTrail, a service that provides a record of actions taken by a user, role, or an Amazon service in S3 Glacier. CloudTrail captures all API calls for S3 Glacier as events, including calls from the S3 Glacier console and from code calls to the S3 Glacier APIs. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for S3 Glacier. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in Event history. Using the information collected by CloudTrail, you can determine the request that was made to S3 Glacier, the IP address from which the request was made, who made the request, when it was made, and additional details.

To learn more about CloudTrail, see the Amazon CloudTrail User Guide.

Amazon S3 Glacier Information in CloudTrail

CloudTrail is enabled on your Amazon Web Services account when you create the account. When activity occurs in S3 Glacier, that activity is recorded in a CloudTrail event along with other Amazon service events in Event history. You can view, search, and download recent events in your Amazon Web Services account. For more information, see Viewing Events with CloudTrail Event History.

For an ongoing record of events in your Amazon Web Services account, including events for S3 Glacier, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all Amazon Regions. The trail logs events from all Amazon Regions in the Amazon partition and delivers the log files to the Amazon S3 bucket that you specify. Additionally, you can configure other Amazon services to further analyze and act upon the event data collected in CloudTrail logs. For more information, see:

All S3 Glacier actions are logged by CloudTrail and are documented in the API Reference for Amazon S3 Glacier. For example, calls to the Create Vault (PUT vault), Delete Vault (DELETE vault), and List Vaults (GET vaults) actions generate entries in the CloudTrail log files.

Every event or log entry contains information about who generated the request. The identity information helps you determine the following:

  • Whether the request was made with root user or other credentials.

  • Whether the request was made with temporary security credentials for a role or federated user.

  • Whether the request was made by another Amazon service.

For more information, see the CloudTrail userIdentity Element.

Understanding Amazon S3 Glacier Log File Entries

A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify. CloudTrail log files contain one or more log entries. An event represents a single request from any source and includes information about the requested action, the date and time of the action, request parameters, and so on. CloudTrail log files are not an ordered stack trace of the public API calls, so they do not appear in any specific order.

The following example shows a CloudTrail log entry that demonstrates the Create Vault (PUT vault), Delete Vault (DELETE vault), List Vaults (GET vaults), and Describe Vault (GET vault) actions.

{ "Records": [ { "awsRegion": "us-east-1", "eventID": "52f8c821-002e-4549-857f-8193a15246fa", "eventName": "CreateVault", "eventSource": "glacier.amazonaws.com", "eventTime": "2014-12-10T19:05:15Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "999999999999", "requestID": "HJiLgvfXCY88QJAC6rRoexS9ThvI21Q1Nqukfly02hcUPPo", "requestParameters": { "accountId": "-", "vaultName": "myVaultName" }, "responseElements": { "location": "/999999999999/vaults/myVaultName" }, "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/1.9.6 Mac_OS_X/10.9.5 Java_HotSpot(TM)_64-Bit_Server_VM/25.25-b02/1.8.0_25", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "999999999999", "arn": "arn:aws:iam::999999999999:user/myUserName", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "myUserName" } }, { "awsRegion": "us-east-1", "eventID": "cdd33060-4758-416a-b7b9-dafd3afcec90", "eventName": "DeleteVault", "eventSource": "glacier.amazonaws.com", "eventTime": "2014-12-10T19:05:15Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "999999999999", "requestID": "GGdw-VfhVfLCFwAM6iVUvMQ6-fMwSqSO9FmRd0eRSa_Fc7c", "requestParameters": { "accountId": "-", "vaultName": "myVaultName" }, "responseElements": null, "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/1.9.6 Mac_OS_X/10.9.5 Java_HotSpot(TM)_64-Bit_Server_VM/25.25-b02/1.8.0_25", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "999999999999", "arn": "arn:aws:iam::999999999999:user/myUserName", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "myUserName" } }, { "awsRegion": "us-east-1", "eventID": "355750b4-e8b0-46be-9676-e786b1442470", "eventName": "ListVaults", "eventSource": "glacier.amazonaws.com", "eventTime": "2014-12-10T19:05:15Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "999999999999", "requestID": "yPTs22ghTsWprFivb-2u30FAaDALIZP17t4jM_xL9QJQyVA", "requestParameters": { "accountId": "-" }, "responseElements": null, "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/1.9.6 Mac_OS_X/10.9.5 Java_HotSpot(TM)_64-Bit_Server_VM/25.25-b02/1.8.0_25", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "999999999999", "arn": "arn:aws:iam::999999999999:user/myUserName", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "myUserName" } }, { "awsRegion": "us-east-1", "eventID": "569e830e-b075-4444-a826-aa8b0acad6c7", "eventName": "DescribeVault", "eventSource": "glacier.amazonaws.com", "eventTime": "2014-12-10T19:05:15Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "999999999999", "requestID": "QRt1ZdFLGn0TCm784HmKafBmcB2lVaV81UU3fsOR3PtoIiM", "requestParameters": { "accountId": "-", "vaultName": "myVaultName" }, "responseElements": null, "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/1.9.6 Mac_OS_X/10.9.5 Java_HotSpot(TM)_64-Bit_Server_VM/25.25-b02/1.8.0_25", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "999999999999", "arn": "arn:aws:iam::999999999999:user/myUserName", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "myUserName" } } ] }