Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CreateVolumeCommand

Creates an EBS volume that can be attached to an instance in the same Availability Zone.

You can create a new empty volume or restore a volume from an EBS snapshot. Any Amazon Web Services Marketplace product codes from the snapshot are propagated to the volume.

You can create encrypted volumes. Encrypted volumes must be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

You can tag your volumes during creation. For more information, see Tag your Amazon EC2 resources in the Amazon Elastic Compute Cloud User Guide.

For more information, see Create an Amazon EBS volume in the Amazon Elastic Compute Cloud User Guide.

example

Use a bare-bones client and the command you need to make an API call.

import { EC2Client, CreateVolumeCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, CreateVolumeCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const command = new CreateVolumeCommand(input);
const response = await client.send(command);
see

CreateVolumeCommandInput for command's input shape.

see

CreateVolumeCommandOutput for command's response shape.

see

config for EC2Client's config shape.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly input

input: CreateVolumeCommandInput

Readonly middlewareStack

middlewareStack: IMiddlewareStack<CreateVolumeCommandInput, CreateVolumeCommandOutput>

Methods

Static getEndpointParameterInstructions