将 DeleteBucketTagging 与 CLI 配合使用 - AWS SDK 代码示例

AWS 文档 SDK 示例 GitHub 存储库中还有更多 AWS SDK 示例。

DeleteBucketTagging 与 CLI 配合使用

以下代码示例演示如何使用 DeleteBucketTagging

CLI
AWS CLI

以下命令从名为 amzn-s3-demo-bucket 的存储桶中删除标记配置:

aws s3api delete-bucket-tagging --bucket amzn-s3-demo-bucket
PowerShell
Tools for PowerShell V4

示例 1:此命令移除与给定 S3 存储桶关联的所有标签。

Remove-S3BucketTagging -BucketName 'amzn-s3-demo-bucket'

输出

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3BucketTagging (DeleteBucketTagging)" on target "amzn-s3-demo-bucket". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • 有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 DeleteBucketTagging

Tools for PowerShell V5

示例 1:此命令移除与给定 S3 存储桶关联的所有标签。

Remove-S3BucketTagging -BucketName 'amzn-s3-demo-bucket'

输出

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3BucketTagging (DeleteBucketTagging)" on target "amzn-s3-demo-bucket". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • 有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 DeleteBucketTagging