Use GetBucketNotification with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use GetBucketNotification with an AWS SDK or CLI

The following code examples show how to use GetBucketNotification.

CLI
AWS CLI

The following command retrieves the notification configuration for a bucket named my-bucket:

aws s3api get-bucket-notification --bucket my-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

Example 1: This example retrieves notification configuration of the given bucket

Get-S3BucketNotification -BucketName kt-tools | select -ExpandProperty TopicConfigurations

Output:

Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1