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

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@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.

You can tag your snapshots during creation. For more information, see Tagging Your Amazon EC2 Resources .

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:

  • ccTagSpecifications - The tags to apply to the snapshot during creation.
  • 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 # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

Data CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

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 # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

Show CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

Generic CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

Associated Types

type Rep CreateSnapshot :: Type -> Type #

Hashable CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

AWSRequest CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

Associated Types

type Rs CreateSnapshot :: Type #

ToHeaders CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

ToPath CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

ToQuery CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

NFData CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

Methods

rnf :: CreateSnapshot -> () #

type Rep CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

type Rep CreateSnapshot = D1 (MetaData "CreateSnapshot" "Network.AWS.EC2.CreateSnapshot" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "CreateSnapshot'" PrefixI True) ((S1 (MetaSel (Just "_ccTagSpecifications") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [TagSpecification])) :*: S1 (MetaSel (Just "_ccDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "_ccDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "_ccVolumeId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))
type Rs CreateSnapshot Source # 
Instance details

Defined in Network.AWS.EC2.CreateSnapshot

Request Lenses

ccTagSpecifications :: Lens' CreateSnapshot [TagSpecification] Source #

The tags to apply to the snapshot during creation.

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 # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Data Snapshot Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

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 # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Show Snapshot Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Generic Snapshot Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Associated Types

type Rep Snapshot :: Type -> Type #

Methods

from :: Snapshot -> Rep Snapshot x #

to :: Rep Snapshot x -> Snapshot #

Hashable Snapshot Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Methods

hashWithSalt :: Int -> Snapshot -> Int #

hash :: Snapshot -> Int #

FromXML Snapshot Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

NFData Snapshot Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Methods

rnf :: Snapshot -> () #

type Rep Snapshot Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

type Rep Snapshot = D1 (MetaData "Snapshot" "Network.AWS.EC2.Types.Product" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "Snapshot'" PrefixI True) (((S1 (MetaSel (Just "_sStateMessage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "_sOwnerAlias") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_sDataEncryptionKeyId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 (MetaSel (Just "_sKMSKeyId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_sTags") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Tag]))) :*: (S1 (MetaSel (Just "_sSnapshotId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_sOwnerId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))) :*: ((S1 (MetaSel (Just "_sVolumeId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: (S1 (MetaSel (Just "_sVolumeSize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "_sDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))) :*: ((S1 (MetaSel (Just "_sStartTime") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ISO8601) :*: S1 (MetaSel (Just "_sProgress") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) :*: (S1 (MetaSel (Just "_sState") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 SnapshotState) :*: S1 (MetaSel (Just "_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.