Skip to content

Is an example S3 event notification available for Glacier-related events?

0

Can anyone confirm if Glacier restorations generate GET/PUT/etc event notifications? Or better yet, is an example notification available somewhere?

I'm currently building a tool that accepts an s3 event notification once a file has been restored from Glacier. As such, I'm looking for documentation and/or examples of what JSON schema to expect. The docs at https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-content-structure.html have been very helpful, but it looks like the schema changes based on HTTP verb, and there are specific Glacier fields.

  • Yes S3 does have event notification for Glacier Restore operations. If you read the documentation which you posted - it's mentioned that glacier restore event follow 2.1 event schema version. The eventName field will have value 's3:ObjectRestore:Completed'

asked 2 years ago149 views

1 Answer
1

Glacier restorations do not generate standard S3 event notifications like GET, PUT, or DELETE. Instead, S3 provides specific event types for Glacier-related operations:

s3:ObjectRestore:Post - This event is triggered when a restore request is initiated for an object in Glacier.
s3:ObjectRestore:Completed - This event is triggered when a restore operation is completed and the object is available for access.

These events are part of the S3 Event Notifications system, but they are specific to Glacier operations.

Here's an example of what the JSON structure for an s3:ObjectRestore:Completed event might look like:

{ "Records": [ { "eventVersion": "2.1", "eventSource": "aws:s3", "awsRegion": "us-west-2", "eventTime": "2023-05-10T15:00:00.000Z", "eventName": "s3:ObjectRestore:Completed", "userIdentity": { "principalId": "EXAMPLE" }, "requestParameters": { "sourceIPAddress": "127.0.0.1" }, "responseElements": { "x-amz-request-id": "EXAMPLE123456789", "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH" }, "s3": { "s3SchemaVersion": "1.0", "configurationId": "testConfigRule", "bucket": { "name": "example-bucket", "ownerIdentity": { "principalId": "EXAMPLE" }, "arn": "arn:aws:s3:::example-bucket" }, "object": { "key": "test/key", "size": 1024, "eTag": "0123456789abcdef0123456789abcdef", "sequencer": "0A1B2C3D4E5F678901" } }, "glacierEventData": { "restoreEventData": { "lifecycleRestorationExpiryTime": "2023-05-17T15:00:00.000Z", "lifecycleRestoreStorageClass": "STANDARD" } } } ] }

Key points to note:

The eventName is "s3:ObjectRestore:Completed".
There's a glacierEventData field containing restoration-specific information.
The restoreEventData includes the expiry time of the restored object and the storage class it was restored to.

To use this in your tool:

Set up an S3 event notification for the "s3:ObjectRestore:Completed" event type.
Configure your tool to receive and parse this JSON structure.
Look for the glacierEventData field to confirm it's a Glacier restoration event.
Use the information in s3.object to identify which object was restored.

Remember, the exact structure might vary slightly based on your specific setup and AWS region. Always test with your actual environment to ensure compatibility.

AWS

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.