Utilícelo GetBucketNotification con o AWS SDK CLI - AWS SDKEjemplos de código

Hay más AWS SDK ejemplos disponibles en el GitHub repositorio de AWS Doc SDK Examples.

Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.

Utilícelo GetBucketNotification con o AWS SDK 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:*" ] } }
PowerShell
Herramientas para PowerShell

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 API obtener más información, consulte GetBucketNotificationla referencia de AWS Tools for PowerShell cmdlets.