Creating a S3 Glacier Vault - AWS SDK for JavaScript

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!") } });