搭GetBucketNotification配使用 AWS SDK或 CLI - Amazon Simple Storage Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

GetBucketNotification配使用 AWS SDK或 CLI

下列程式碼範例會示範如何使用GetBucketNotification

CLI
AWS CLI

下列命令會擷取名為的值區的通知組態my-bucket

aws s3api get-bucket-notification --bucket my-bucket

輸出:

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

範例 1:此範例擷取指定值區的通知組態

Get-S3BucketNotification -BucketName kt-tools | select -ExpandProperty TopicConfigurations

輸出:

Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1
  • 有API關詳細資訊,請參閱 GetBucketNotificationAWS Tools for PowerShell 指令程式參照

有關的完整列表 AWS SDK開發人員指南和代碼示例,請參閱搭配 AWS SDK 使用此服務。本主題也包含有關入門的資訊以及舊SDK版的詳細資訊。