Creating a S3 Glacier Vault - AWS SDK for JavaScript

We announced the upcoming end-of-support for AWS SDK for JavaScript v2. We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Creating a S3 Glacier Vault

JavaScript code example that applies to Node.js execution

This Node.js code example shows:

  • How to create a vault using the createVault method of the Amazon S3 Glacier service object.

Prerequisite Tasks

To set up and run this example, you must first complete these tasks:

Create the Vault

// Load the SDK for JavaScript var AWS = require("aws-sdk"); // Set the region AWS.config.update({ region: "REGION" }); // Create a new service object var glacier = new AWS.Glacier({ apiVersion: "2012-06-01" }); // Call Glacier to create the vault glacier.createVault({ vaultName: "YOUR_VAULT_NAME" }, function (err) { if (!err) { console.log("Created vault!"); } });