Usar DeleteBucketInventoryConfiguration com uma CLI - Exemplos de código do AWS SDK

Há mais exemplos do AWS SDK disponíveis no repositório do GitHub Documento de Exemplos do AWS SDK.

Usar DeleteBucketInventoryConfiguration com uma CLI

Os exemplos de código a seguir mostram como usar o DeleteBucketInventoryConfiguration.

CLI
AWS CLI

Para excluir a configuração de inventário de um bucket

O exemplo delete-bucket-inventory-configuration a seguir exclui a configuração do inventário com ID 1 do bucket especificado.

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

Este comando não produz saída.

PowerShell
Ferramentas para PowerShell V4

Exemplo 1: este comando remove o inventário denominado “testInventoryName” correspondente ao bucket do S3 em questão.

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

Saída:

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
Ferramentas para PowerShell V5

Exemplo 1: este comando remove o inventário denominado “testInventoryName” correspondente ao bucket do S3 em questão.

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

Saída:

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