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).
Use GetBucketNotification
with a CLI
The following code examples show how to use GetBucketNotification
.
- CLI
-
- Amazon CLI
-
The following command retrieves the notification configuration for a bucket named amzn-s3-demo-bucket
:
aws s3api get-bucket-notification --bucket amzn-s3-demo-bucket
Output:
{
"TopicConfiguration": {
"Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic",
"Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl",
"Event": "s3:ObjectCreated:*",
"Events": [
"s3:ObjectCreated:*"
]
}
}
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example retrieves notification configuration of the given bucket
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations
Output:
Id Topic
-- -----
mimo arn:aws:sns:eu-west-1:123456789012:topic-1
For a complete list of Amazon SDK developer guides and code examples, see
Developing with Amazon S3 using the Amazon SDKs.
This topic also includes information about getting started and details about previous SDK versions.