amazonka-ec2-1.3.0: Amazon Elastic Compute Cloud SDK.

Copyright(c) 2013-2015 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <>
Portabilitynon-portable (GHC extensions)
Safe HaskellNone




Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of EBS volumes, and to save data before shutting down an instance.

When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.

You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your EBS volume at the time the snapshot command is issued; this may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending.

To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.

Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.

For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

See: AWS API Reference for CreateSnapshot.


Creating a Request

createSnapshot Source

Creates a value of CreateSnapshot with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

Request Lenses

ccDescription :: Lens' CreateSnapshot (Maybe Text) Source

A description for the snapshot.

ccDryRun :: Lens' CreateSnapshot (Maybe Bool) Source

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.

ccVolumeId :: Lens' CreateSnapshot Text Source

The ID of the EBS volume.

Destructuring the Response

data Snapshot Source

Describes a snapshot.

See: snapshot smart constructor.

Response Lenses

sOwnerAlias :: Lens' Snapshot (Maybe Text) Source

The AWS account alias (for example, amazon, self) or AWS account ID that owns the snapshot.

sKMSKeyId :: Lens' Snapshot (Maybe Text) Source

The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.

sTags :: Lens' Snapshot [Tag] Source

Any tags assigned to the snapshot.

sSnapshotId :: Lens' Snapshot Text Source

The ID of the snapshot.

sOwnerId :: Lens' Snapshot Text Source

The AWS account ID of the EBS snapshot owner.

sVolumeId :: Lens' Snapshot Text Source

The ID of the volume.

sVolumeSize :: Lens' Snapshot Int Source

The size of the volume, in GiB.

sDescription :: Lens' Snapshot Text Source

The description for the snapshot.

sStartTime :: Lens' Snapshot UTCTime Source

The time stamp when the snapshot was initiated.

sProgress :: Lens' Snapshot Text Source

The progress of the snapshot, as a percentage.

sState :: Lens' Snapshot SnapshotState Source

The snapshot state.

sEncrypted :: Lens' Snapshot Bool Source

Indicates whether the snapshot is encrypted.