Uso de GetBucketNotification con un AWS SDK o una CLI - Amazon Simple Storage Service

Uso de GetBucketNotification con un AWS SDK o una CLI

En los siguientes ejemplos de código, se muestra cómo utilizar GetBucketNotification.

CLI
AWS CLI

El siguiente comando recupera la configuración de notificaciones de un bucket denominado my-bucket:

aws s3api get-bucket-notification --bucket my-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 en la Referencia de comandos de la AWS CLI.

PowerShell
Herramientas para PowerShell

Ejemplo 1: en este ejemplo se recupera la configuración de notificaciones del bucket en cuestión

Get-S3BucketNotification -BucketName kt-tools | 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 en la Referencia de Cmdlet de AWS Tools for PowerShell.

Para obtener una lista completa de las guías para desarrolladores del AWS SDK y ejemplos de código, consulte Uso de este servicio con un SDK de AWS. En este tema también se incluye información sobre cómo comenzar a utilizar el SDK y detalles sobre sus versiones anteriores.