

# Utilizar `GetBucketNotification` con una CLI
<a name="s3_example_s3_GetBucketNotification_section"></a>

Los siguientes ejemplos de código muestran cómo utilizar `GetBucketNotification`.

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

**AWS CLI**  
El siguiente comando recupera la configuración de notificaciones de un bucket denominado `amzn-s3-demo-bucket`:  

```
aws s3api get-bucket-notification --bucket {{amzn-s3-demo-bucket}}
```
Salida:  

```
{
    "TopicConfiguration": {
        "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic",
        "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl",
        "Event": "s3:ObjectCreated:*",
        "Events": [
            "s3:ObjectCreated:*"
        ]
    }
}
```
+  Para obtener información sobre la API, consulte [GetBucketNotification](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/get-bucket-notification.html) en la *Referencia de comandos de la AWS CLI*. 

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

**Herramientas para PowerShell V4**  
**Ejemplo 1: en este ejemplo se recupera la configuración de notificaciones del bucket en cuestión**  

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

```
Id   Topic
--   -----
mimo arn:aws:sns:eu-west-1:123456789012:topic-1
```
+  Para obtener información sobre la API, consulte [GetBucketNotification](https://docs.aws.amazon.com/powershell/v4/reference) en la *Referencia de cmdlets de Herramientas de AWS para PowerShell (V4)*. 

**Herramientas para PowerShell V5**  
**Ejemplo 1: en este ejemplo se recupera la configuración de notificaciones del bucket en cuestión**  

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

```
Id   Topic
--   -----
mimo arn:aws:sns:eu-west-1:123456789012:topic-1
```
+  Para obtener información sobre la API, consulte [GetBucketNotification](https://docs.aws.amazon.com/powershell/v5/reference) en la *Referencia de cmdlets de Herramientas de AWS para PowerShell (V5)*. 

------

Para obtener una lista completa de las guías para desarrolladores de AWS SDK y ejemplos de código, consulte [Desarrollo con Amazon S3 mediante los SDK de AWS](sdk-general-information-section.md). En este tema también se incluye información sobre cómo empezar a utilizar el SDK y detalles sobre sus versiones anteriores.