搭配使用 DeleteBucketInventoryConfiguration 與 CLI - AWS SDK 程式碼範例

AWS文件開發套件範例 GitHub 儲存庫中有更多可用的 AWS SDK 範例。

搭配使用 DeleteBucketInventoryConfiguration 與 CLI

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

CLI
AWS CLI

刪除儲存貯體的庫存組態

下列 delete-bucket-inventory-configuration 範例會刪除具有指定儲存貯體 ID 1 的庫存組態。

aws s3api delete-bucket-inventory-configuration \ --bucket amzn-s3-demo-bucket \ --id 1

此命令不會產生輸出。

PowerShell
Tools for PowerShell V4

範例 1:此命令會移除與給定 S3 儲存貯體對應之名為 'testInventoryName' 的庫存。

Remove-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testInventoryName'

輸出:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3BucketInventoryConfiguration (DeleteBucketInventoryConfiguration)" 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
Tools for PowerShell V5

範例 1:此命令會移除與給定 S3 儲存貯體對應之名為 'testInventoryName' 的庫存。

Remove-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testInventoryName'

輸出:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3BucketInventoryConfiguration (DeleteBucketInventoryConfiguration)" 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