Both the high-level and low-level APIs provided by the AWS SDK for .NET provide a method to delete a vault.
The ArchiveTransferManager class of the high-level API provides the DeleteVault method you can use to delete a vault.
For a working code example, see Example: Vault Operations Using the High-Level API of the AWS SDK for .NET . The C# code example shows basic vault operations including create and delete vault.
The following are the steps to delete a vault using the AWS SDK for .NET.
You need to specify an AWS region from where you want to delete a vault. All operations you perform using this client apply to that region.
Provide request information by creating an instance of the DeleteVaultRequest class.
You need to provide the vault name and account ID. If you don't provide an account ID, then account ID associated with the credentials you provide to sign the request is assumed. For more information, see Using the AWS SDK for .NET with Amazon S3 Glacier.
Execute the DeleteVault method by providing the request object as a parameter.
Amazon S3 Glacier (Glacier) deletes the vault only if it is empty. For more information, see Delete Vault (DELETE vault).
The following C# code snippet illustrates the preceding steps. The snippet retrieves metadata information of a vault that exists in the default AWS region.
VaultName = "*** provide vault name ***"
For information about the underlying REST API, see Delete Vault (DELETE vault).
For a working code example, see Example: Vault Operations Using the Low-Level API of the AWS SDK for .NET . The C# code example shows basic vault operations including create and delete vault.