Skip to content

EC2  >  Operations  >  create_snapshots

create_snapshots

Operation

create_snapshots async

create_snapshots(input: CreateSnapshotsInput, plugins: list[Plugin] | None = None) -> CreateSnapshotsOutput

Creates crash-consistent snapshots of multiple EBS volumes attached to an Amazon EC2 instance. Volumes are chosen by specifying an instance. Each volume attached to the specified instance will produce one snapshot that is crash-consistent across the instance. You can include all of the volumes currently attached to the instance, or you can exclude the root volume or specific data (non-root) volumes from the multi-volume snapshot set.

The location of the source instance determines where you can create the snapshots.

  • If the source instance is in a Region, you must create the snapshots in the same Region as the instance.

  • If the source instance is in a Local Zone, you can create the snapshots in the same Local Zone or in its parent Amazon Web Services Region.

  • If the source instance is on an Outpost, you can create the snapshots on the same Outpost or in its parent Amazon Web Services Region.

Parameters:

Name Type Description Default
input CreateSnapshotsInput

An instance of CreateSnapshotsInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateSnapshotsOutput

An instance of CreateSnapshotsOutput.

Input

CreateSnapshotsInput dataclass

Bases: _SerdeShape

Dataclass for CreateSnapshotsInput structure.

Attributes

copy_tags_from_source class-attribute instance-attribute
copy_tags_from_source: str | None = ...

Copies the tags from the specified volume to corresponding snapshot.

description class-attribute instance-attribute
description: str | None = ...

A description propagated to every snapshot specified by the instance.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

instance_specification class-attribute instance-attribute
instance_specification: InstanceSpecification | None = ...

The instance to specify which volumes should be included in the snapshots.

location class-attribute instance-attribute
location: str | None = ...
Note

Only supported for instances in Local Zones. If the source instance is not in a Local Zone, omit this parameter.

  • To create local snapshots in the same Local Zone as the source instance, specify local.

  • To create regional snapshots in the parent Region of the Local Zone, specify regional or omit this parameter.

Default value: regional

outpost_arn class-attribute instance-attribute
outpost_arn: str | None = ...
Note

Only supported for instances on Outposts. If the source instance is not on an Outpost, omit this parameter.

  • To create the snapshots on the same Outpost as the source instance, specify the ARN of that Outpost. The snapshots must be created on the same Outpost as the instance.

  • To create the snapshots in the parent Region of the Outpost, omit this parameter.

For more information, see Create local snapshots from volumes on an Outpost in the Amazon EBS User Guide.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

Tags to apply to every snapshot specified by the instance.

Output

CreateSnapshotsOutput dataclass

Bases: _SerdeShape

Dataclass for CreateSnapshotsOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

snapshots class-attribute instance-attribute
snapshots: list[SnapshotInfo] | None = ...

List of snapshots.