We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.
If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”
Customize cookie preferences
We use cookies and similar tools (collectively, "cookies") for the following purposes.
Essential
Essential cookies are necessary to provide our site and services and cannot be deactivated. They are usually set in response to your actions on the site, such as setting your privacy preferences, signing in, or filling in forms.
Performance
Performance cookies provide anonymous statistics about how customers navigate our site so we can improve site experience and performance. Approved third parties may perform analytics on our behalf, but they cannot use the data for their own purposes.
Allowed
Functional
Functional cookies help us provide useful site features, remember your preferences, and display relevant content. Approved third parties may set these cookies to provide certain site features. If you do not allow these cookies, then some or all of these services may not function properly.
Allowed
Advertising
Advertising cookies may be set through our site by us or our advertising partners and help us deliver relevant marketing content. If you do not allow these cookies, you will experience less relevant advertising.
Allowed
Blocking some types of cookies may impact your experience of our sites. You may review and change your choices at any time by selecting Cookie preferences in the footer of this site. We and selected third-parties use cookies or similar technologies as specified in the AWS Cookie Notice.
Unable to save cookie preferences
We will only store essential cookies at this time, because we were unable to save your cookie preferences.
If you want to change your cookie preferences, try again later using the link in the AWS console footer, or contact support if the problem persists.
This page is only for existing customers of the S3 Glacier service using Vaults and the original REST API from 2012.
If you're looking for archival storage solutions we suggest using the S3 Glacier storage classes in Amazon S3, S3 Glacier Instant Retrieval, S3 Glacier Flexible Retrieval, and S3 Glacier Deep Archive. To learn more about these storage options, see S3 Glacier storage classes and
Long-term data storage using S3 Glacier storage classes in the Amazon S3 User
Guide. These storage classes use the Amazon S3 API, are available in all regions, and can be managed within the Amazon S3 console. They offer features like Storage Cost Analysis, Storage Lens, advanced optional encryption features, and more.
This page is only for existing customers of the S3 Glacier service using Vaults and the original REST API from 2012.
If you're looking for archival storage solutions we suggest using the S3 Glacier storage classes in Amazon S3, S3 Glacier Instant Retrieval, S3 Glacier Flexible Retrieval, and S3 Glacier Deep Archive. To learn more about these storage options, see S3 Glacier storage classes and
Long-term data storage using S3 Glacier storage classes in the Amazon S3 User
Guide. These storage classes use the Amazon S3 API, are available in all regions, and can be managed within the Amazon S3 console. They offer features like Storage Cost Analysis, Storage Lens, advanced optional encryption features, and more.
This command does not produce any output. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
For API details, see
DeleteVault
in AWS CLI Command Reference.
Java
SDK for Java 2.x
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the
AWS Code
Examples Repository.
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.glacier.GlacierClient;
import software.amazon.awssdk.services.glacier.model.DeleteVaultRequest;
import software.amazon.awssdk.services.glacier.model.GlacierException;
/**
* Before running this Java V2 code example, set up your development
* environment, including your credentials.
*
* For more information, see the following documentation topic:
*
* https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html
*/publicclassDeleteVault{publicstaticvoidmain(String[] args){final String usage = """
Usage: <vaultName>
Where:
vaultName - The name of the vault to delete.\s
""";
if (args.length != 1) {
System.out.println(usage);
System.exit(1);
}
String vaultName = args[0];
GlacierClient glacier = GlacierClient.builder()
.region(Region.US_EAST_1)
.build();
deleteGlacierVault(glacier, vaultName);
glacier.close();
}
publicstaticvoiddeleteGlacierVault(GlacierClient glacier, String vaultName){try{
DeleteVaultRequest delVaultRequest = DeleteVaultRequest.builder()
.vaultName(vaultName)
.build();
glacier.deleteVault(delVaultRequest);
System.out.println("The vault was deleted!");
} catch (GlacierException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
}
For API details, see
DeleteVault
in AWS SDK for Java 2.x API Reference.
Python
SDK for Python (Boto3)
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the
AWS Code
Examples Repository.
classGlacierWrapper:"""Encapsulates Amazon S3 Glacier API operations."""def__init__(self, glacier_resource):"""
:param glacier_resource: A Boto3 Amazon S3 Glacier resource.
"""
self.glacier_resource = glacier_resource
@staticmethoddefdelete_vault(vault):"""
Deletes a vault.
:param vault: The vault to delete.
"""try:
vault.delete()
logger.info("Deleted vault %s.", vault.name)
except ClientError:
logger.exception("Couldn't delete vault %s.", vault.name)
raise
For API details, see
DeleteVault
in AWS SDK for Python (Boto3) API Reference.
This command does not produce any output. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
For API details, see
DeleteVault
in AWS CLI Command Reference.
For a complete list of AWS SDK developer guides and code examples, see
Using S3 Glacier with an AWS SDK.
This topic also includes information about getting started and details about previous SDK versions.
Did this page help you? - Yes
Thanks for letting us know we're doing a good job!
If you've got a moment, please tell us what we did right so we can do more of it.
Did this page help you? - No
Thanks for letting us know this page needs work. We're sorry we let you down.
If you've got a moment, please tell us how we can make the documentation better.