Creating a S3 Glacier Vault - Amazon SDK for JavaScript
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

We announced the upcoming end-of-support for Amazon SDK for JavaScript v2. We recommend that you migrate to Amazon 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!"); } });