

Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 [AWS](https://github.com/awsdocs/aws-doc-sdk-examples)

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# CLI で `GetBucketNotification` を使用する
<a name="s3_example_s3_GetBucketNotification_section"></a>

次のサンプルコードは、`GetBucketNotification` を使用する方法を説明しています。

------
#### [ CLI ]

**AWS CLI**  
次のコマンドは、`amzn-s3-demo-bucket` という名前のバケットの通知設定を取得します。  

```
aws s3api get-bucket-notification --bucket amzn-s3-demo-bucket
```
出力:  

```
{
    "TopicConfiguration": {
        "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic",
        "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl",
        "Event": "s3:ObjectCreated:*",
        "Events": [
            "s3:ObjectCreated:*"
        ]
    }
}
```
+  API の詳細については、「**AWS CLI コマンドリファレンス」の「[GetBucketNotification](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/get-bucket-notification.html)」を参照してください。

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**例 1: この例では、指定したバケットの通知設定を取得します。**  

```
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations
```
**出力:**  

```
Id   Topic
--   -----
mimo arn:aws:sns:eu-west-1:123456789012:topic-1
```
+  API の詳細については、「*AWS Tools for PowerShell コマンドレットリファレンス (V4)*」の「[GetBucketNotification](https://docs.aws.amazon.com/powershell/v4/reference)」を参照してください。

**Tools for PowerShell V5**  
**例 1: この例では、指定したバケットの通知設定を取得します。**  

```
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations
```
**出力:**  

```
Id   Topic
--   -----
mimo arn:aws:sns:eu-west-1:123456789012:topic-1
```
+  API の詳細については、AWS Tools for PowerShell コマンドレットリファレンス (V5) の「[GetBucketNotification](https://docs.aws.amazon.com/powershell/v5/reference)」を参照してください。**

------