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

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.EC2.CreateSnapshot

Contents

Description

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 .

Synopsis

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:

  • ccDescription - A description for the snapshot.
  • ccDryRun - 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 - The ID of the EBS volume.

data CreateSnapshot Source #

Contains the parameters for CreateSnapshot.

See: createSnapshot smart constructor.

Instances

Eq CreateSnapshot Source # 
Data CreateSnapshot Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreateSnapshot -> c CreateSnapshot #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreateSnapshot #

toConstr :: CreateSnapshot -> Constr #

dataTypeOf :: CreateSnapshot -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CreateSnapshot) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreateSnapshot) #

gmapT :: (forall b. Data b => b -> b) -> CreateSnapshot -> CreateSnapshot #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreateSnapshot -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreateSnapshot -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreateSnapshot -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreateSnapshot -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreateSnapshot -> m CreateSnapshot #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSnapshot -> m CreateSnapshot #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSnapshot -> m CreateSnapshot #

Read CreateSnapshot Source # 
Show CreateSnapshot Source # 
Generic CreateSnapshot Source # 

Associated Types

type Rep CreateSnapshot :: * -> * #

Hashable CreateSnapshot Source # 
NFData CreateSnapshot Source # 

Methods

rnf :: CreateSnapshot -> () #

AWSRequest CreateSnapshot Source # 
ToPath CreateSnapshot Source # 
ToHeaders CreateSnapshot Source # 
ToQuery CreateSnapshot Source # 
type Rep CreateSnapshot Source # 
type Rep CreateSnapshot = D1 (MetaData "CreateSnapshot" "Network.AWS.EC2.CreateSnapshot" "amazonka-ec2-1.4.5-4J1X1aohvSR7xjHvMmTrf6" False) (C1 (MetaCons "CreateSnapshot'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ccDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_ccDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))) (S1 (MetaSel (Just Symbol "_ccVolumeId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))
type Rs CreateSnapshot Source # 

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

snapshot Source #

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

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

  • sStateMessage - Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by the DescribeSnapshots API operation.
  • sOwnerAlias - Value from an Amazon-maintained list (amazon | aws-marketplace | microsoft ) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console.
  • sDataEncryptionKeyId - The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by the DescribeSnapshots API operation.
  • sKMSKeyId - 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 - Any tags assigned to the snapshot.
  • sSnapshotId - The ID of the snapshot. Each snapshot receives a unique identifier when it is created.
  • sOwnerId - The AWS account ID of the EBS snapshot owner.
  • sVolumeId - The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.
  • sVolumeSize - The size of the volume, in GiB.
  • sDescription - The description for the snapshot.
  • sStartTime - The time stamp when the snapshot was initiated.
  • sProgress - The progress of the snapshot, as a percentage.
  • sState - The snapshot state.
  • sEncrypted - Indicates whether the snapshot is encrypted.

data Snapshot Source #

Describes a snapshot.

See: snapshot smart constructor.

Instances

Eq Snapshot Source # 
Data Snapshot Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Snapshot -> c Snapshot #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Snapshot #

toConstr :: Snapshot -> Constr #

dataTypeOf :: Snapshot -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Snapshot) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Snapshot) #

gmapT :: (forall b. Data b => b -> b) -> Snapshot -> Snapshot #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Snapshot -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Snapshot -> r #

gmapQ :: (forall d. Data d => d -> u) -> Snapshot -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Snapshot -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Snapshot -> m Snapshot #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Snapshot -> m Snapshot #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Snapshot -> m Snapshot #

Read Snapshot Source # 
Show Snapshot Source # 
Generic Snapshot Source # 

Associated Types

type Rep Snapshot :: * -> * #

Methods

from :: Snapshot -> Rep Snapshot x #

to :: Rep Snapshot x -> Snapshot #

Hashable Snapshot Source # 

Methods

hashWithSalt :: Int -> Snapshot -> Int #

hash :: Snapshot -> Int #

NFData Snapshot Source # 

Methods

rnf :: Snapshot -> () #

FromXML Snapshot Source # 
type Rep Snapshot Source # 
type Rep Snapshot = D1 (MetaData "Snapshot" "Network.AWS.EC2.Types.Product" "amazonka-ec2-1.4.5-4J1X1aohvSR7xjHvMmTrf6" False) (C1 (MetaCons "Snapshot'" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_sStateMessage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_sOwnerAlias") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_sDataEncryptionKeyId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_sKMSKeyId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_sTags") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Tag])))) ((:*:) (S1 (MetaSel (Just Symbol "_sSnapshotId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_sOwnerId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_sVolumeId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "_sVolumeSize") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)) (S1 (MetaSel (Just Symbol "_sDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_sStartTime") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ISO8601)) (S1 (MetaSel (Just Symbol "_sProgress") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))) ((:*:) (S1 (MetaSel (Just Symbol "_sState") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 SnapshotState)) (S1 (MetaSel (Just Symbol "_sEncrypted") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)))))))

Response Lenses

sStateMessage :: Lens' Snapshot (Maybe Text) Source #

Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by the DescribeSnapshots API operation.

sOwnerAlias :: Lens' Snapshot (Maybe Text) Source #

Value from an Amazon-maintained list (amazon | aws-marketplace | microsoft ) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console.

sDataEncryptionKeyId :: Lens' Snapshot (Maybe Text) Source #

The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by the DescribeSnapshots API operation.

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. Each snapshot receives a unique identifier when it is created.

sOwnerId :: Lens' Snapshot Text Source #

The AWS account ID of the EBS snapshot owner.

sVolumeId :: Lens' Snapshot Text Source #

The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.

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.