This page is only for existing customers of the Amazon Glacier service using Vaults and the original REST API from 2012.
If you're looking for archival storage solutions, we recommend using the Amazon 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 Amazon Glacier storage classes
Amazon Glacier (original standalone vault-based service) will no longer accept new customers starting December 15, 2025, with no impact to existing customers. Amazon Glacier is a standalone service with its own APIs that stores data in vaults and is distinct from Amazon S3 and the Amazon S3 Glacier storage classes. Your existing data will remain secure and accessible in Amazon Glacier indefinitely. No migration is required. For low-cost, long-term archival storage, Amazon recommends the Amazon S3 Glacier storage classes
Deleting an Archive in Amazon Glacier Using the Amazon SDK for Java
The following are the steps to delete an archive using the Amazon SDK for Java low-level API.
-
Create an instance of the
AmazonGlacierClientclass (the client).You need to specify an Amazon Region where the archive you want to delete is stored. All operations you perform using this client apply to that Amazon Region.
-
Provide request information by creating an instance of the
DeleteArchiveRequestclass.You need to provide an archive ID, a vault name, and your 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 Amazon SDK for Java with Amazon Glacier.
-
Run the
deleteArchivemethod by providing the request object as a parameter.
The following Java code snippet illustrates the preceding steps.
AmazonGlacierClient client; DeleteArchiveRequest request = new DeleteArchiveRequest() .withVaultName("*** provide a vault name ***") .withArchiveId("*** provide an archive ID ***"); client.deleteArchive(request);
Note
For information about the underlying REST API, see Delete Archive (DELETE archive).
Example: Deleting an Archive Using the Amazon SDK for Java
The following Java code example uses the Amazon SDK for Java to delete an archive. For step-by-step instructions on how to run this example, see Running Java Examples for Amazon Glacier Using Eclipse. You need to update the code as shown with a vault name and the archive ID of the archive you want to delete.
import java.io.IOException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.services.glacier.AmazonGlacierClient; import com.amazonaws.services.glacier.model.DeleteArchiveRequest; public class ArchiveDelete { public static String vaultName = "*** provide vault name ****"; public static String archiveId = "*** provide archive ID***"; public static AmazonGlacierClient client; public static void main(String[] args) throws IOException { ProfileCredentialsProvider credentials = new ProfileCredentialsProvider(); client = new AmazonGlacierClient(credentials); client.setEndpoint("https://glacier.us-east-1.amazonaws.com/"); try { // Delete the archive. client.deleteArchive(new DeleteArchiveRequest() .withVaultName(vaultName) .withArchiveId(archiveId)); System.out.println("Deleted archive successfully."); } catch (Exception e) { System.err.println("Archive not deleted."); System.err.println(e); } } }