Selecione suas preferências de cookies

Usamos cookies essenciais e ferramentas semelhantes que são necessárias para fornecer nosso site e serviços. Usamos cookies de desempenho para coletar estatísticas anônimas, para que possamos entender como os clientes usam nosso site e fazer as devidas melhorias. Cookies essenciais não podem ser desativados, mas você pode clicar em “Personalizar” ou “Recusar” para recusar cookies de desempenho.

Se você concordar, a AWS e terceiros aprovados também usarão cookies para fornecer recursos úteis do site, lembrar suas preferências e exibir conteúdo relevante, incluindo publicidade relevante. Para aceitar ou recusar todos os cookies não essenciais, clique em “Aceitar” ou “Recusar”. Para fazer escolhas mais detalhadas, clique em “Personalizar”.

Use GetBucketNotification with a CLI

Modo de foco
Use GetBucketNotification with a CLI - Amazon Simple Storage Service
Esta página não foi traduzida para seu idioma. Solicitar tradução

The following code examples show how to use GetBucketNotification.

CLI
AWS CLI

The following command retrieves the notification configuration for a bucket named amzn-s3-demo-bucket:

aws s3api get-bucket-notification --bucket amzn-s3-demo-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 amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations

Output:

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

The following command retrieves the notification configuration for a bucket named amzn-s3-demo-bucket:

aws s3api get-bucket-notification --bucket amzn-s3-demo-bucket

Output:

{ "TopicConfiguration": { "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic", "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl", "Event": "s3:ObjectCreated:*", "Events": [ "s3:ObjectCreated:*" ] } }

For a complete list of AWS SDK developer guides and code examples, see Developing with Amazon S3 using the AWS SDKs. This topic also includes information about getting started and details about previous SDK versions.

PrivacidadeTermos do sitePreferências de cookies
© 2025, Amazon Web Services, Inc. ou suas afiliadas. Todos os direitos reservados.