GetBucketNotificationConfiguration
Returns the notification configuration of a bucket.
If notifications are not enabled on the bucket, the operation returns an empty
NotificationConfiguration
element.
By default, you must be the bucket owner to read the notification configuration of
a
bucket. However, the bucket owner can use a bucket policy to grant permission to other
users to read this configuration with the s3:GetBucketNotification
permission.
For more information about setting and reading the notification configuration on a bucket, see Setting Up Notification of Bucket Events. For more information about bucket policies, see Using Bucket Policies.
The following operation is related to GetBucketNotification
:
Request Syntax
GET /?notification HTTP/1.1
Host: Bucket
.s3.amazonaws.com
x-amz-expected-bucket-owner: ExpectedBucketOwner
URI Request Parameters
The request uses the following URI parameters.
- Bucket
-
The name of the bucket for which to get the notification configuration.
Required: Yes
- x-amz-expected-bucket-owner
-
The account id of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP
403 (Access Denied)
error.
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<NotificationConfiguration>
<TopicConfiguration>
<Event>string</Event>
...
<Filter>
<S3Key>
<FilterRule>
<Name>string</Name>
<Value>string</Value>
</FilterRule>
...
</S3Key>
</Filter>
<Id>string</Id>
<Topic>string</Topic>
</TopicConfiguration>
...
<QueueConfiguration>
<Event>string</Event>
...
<Filter>
<S3Key>
<FilterRule>
<Name>string</Name>
<Value>string</Value>
</FilterRule>
...
</S3Key>
</Filter>
<Id>string</Id>
<Queue>string</Queue>
</QueueConfiguration>
...
<CloudFunctionConfiguration>
<Event>string</Event>
...
<Filter>
<S3Key>
<FilterRule>
<Name>string</Name>
<Value>string</Value>
</FilterRule>
...
</S3Key>
</Filter>
<Id>string</Id>
<CloudFunction>string</CloudFunction>
</CloudFunctionConfiguration>
...
</NotificationConfiguration>
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in XML format by the service.
- NotificationConfiguration
-
Root level tag for the NotificationConfiguration parameters.
Required: Yes
- CloudFunctionConfiguration
-
Describes the AWS Lambda functions to invoke and the events for which to invoke them.
Type: Array of LambdaFunctionConfiguration data types
- QueueConfiguration
-
The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.
Type: Array of QueueConfiguration data types
- TopicConfiguration
-
The topic to which notifications are sent and the events for which notifications are generated.
Type: Array of TopicConfiguration data types
Examples
Sample Request
This request returns the notification configuration on the bucket
quotes.s3.<Region>.amazonaws.com
.
GET ?notification HTTP/1.1 Host: quotes.s3.<Region>.amazonaws.com Date: Wed, 15 Oct 2014 16:59:03 GMT Authorization: authorization string
Sample Response
This response returns that the notification configuration for the specified bucket.
HTTP/1.1 200 OK x-amz-id-2: YgIPIfBiKa2bj0KMgUAdQkf3ShJTOOpXUueF6QKo x-amz-request-id: 236A8905248E5A02 Date: Wed, 15 Oct 2014 16:59:04 GMT Server: AmazonS3 <?xml version="1.0" encoding="UTF-8"?> <NotificationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <TopicConfiguration> <Id>YjVkM2Y0YmUtNGI3NC00ZjQyLWEwNGItNDIyYWUxY2I0N2M4</Id> <Topic>arn:aws:sns:us-east-1:account-id:s3notificationtopic2</Topic> <Event>s3:ReducedRedundancyLostObject</Event> <Event>s3:ObjectCreated:*</Event> </TopicConfiguration> </NotificationConfiguration>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: