Configuring event notifications

Enabling S3 event notifications for a bucket enables a tenant to send notifications about specified events to a destination service that supports the AWS Simple Notification Service™ (SNS). You can configure notifications for a bucket using the Tenant Manager.

Before you begin

About this task

After you configure event notifications, whenever a specified event occurs for an object in the source bucket, a notification is generated and sent to the Simple Notification Service (SNS) topic used as the destination endpoint. To enable notifications for a bucket, you must create and apply valid notification configuration XML. The notification configuration XML must use the URN of an event notifications endpoint for each destination.

For general information on event notifications and how to configure them, see Amazon documentation. For information on how StorageGRID Webscale implements the S3 bucket notification configuration API, see the instructions for implementing S3 client applications.

If you enable event notification for a bucket that contains objects, notifications are sent only for actions that are performed after the notification configuration is saved.

Steps

  1. Enable notifications for your source bucket:
    1. Use a text editor to create the notification configuration XML required to enable event notifications, as specified in the S3 notification API.
      When configuring the XML, use the URN of an event notifications endpoint as the destination topic.
      Example
      <NotificationConfiguration>
        <TopicConfiguration>
           <Id>Image-created</Id>
           <Filter>
              <S3Key>
                <FilterRule>
                  <Name>prefix</Name>
                  <Value>images/</Value>
                </FilterRule>
              </S3Key>
          </Filter>
          <Topic>arn:aws:sns:us-east-1:050340950352:sgws-topic</Topic>
          <Event>s3:ObjectCreated:*</Event>
         </TopicConfiguration>
       </NotificationConfiguration>
    2. In the Tenant Manager go to S3 > Buckets.
    3. Select the source bucket, then click Configure Notifications.
    4. Paste the notification configuration XML into the text box, and click Save.

      screenshot of event notification configuration dialog box
      Note: Platform services must be enabled for each tenant account by a StorageGRID Webscale administrator using the Grid Manager or Management API. Contact your grid administrator if an error occurs when you save the configuration XML.
  2. Verify that event notifications are configured correctly:
    1. Perform an action on an object in the source bucket that meets the requirements for triggering a notification as configured in the configuration XML.
      In the example, an event notification is sent whenever an object is created with the images/ prefix.
    2. Confirm that a notification has been delivered to the destination SNS topic.
      Example
      {
         "Records":[
            {
               "eventVersion":"2.0",
               "eventSource":"sgws:s3",
               "eventTime":"2017-08-08T23:52:38Z",
               "eventName":"ObjectCreated:Put",
               "userIdentity":{
                  "principalId":"1111111111111111111"
               },
               "requestParameters":{
                  "sourceIPAddress":"193.51.100.20"
               },
               "responseElements":{
                  "x-amz-request-id":"122047343"
               },
               "s3":{
                  "s3SchemaVersion":"1.0",
                  "configurationId":"Image-created",
                  "bucket":{
                     "name":"test1",
                     "ownerIdentity":{
                        "principalId":"1111111111111111111"
                     },
                     "arn":"arn:sgws:s3:::test1"
                  },
                  "object":{
                     "key":"images/cat.jpg",
                     "size":0,
                     "eTag":"d41d8cd98f00b204e9800998ecf8427e",
                     "sequencer":"14D90402421461C7"
                  }
               }
            }
         ]
      }
      
      For example, if your destination topic is hosted on the AWS Simple Notification Service, you could configure the service to send you an email when the notification is delivered.
    If the notification is received at the destination topic, you have successfully configured your source bucket for StorageGRID Webscale notifications.