Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
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 .
- createSnapshot :: Text -> CreateSnapshot
- data CreateSnapshot
- ccTagSpecifications :: Lens' CreateSnapshot [TagSpecification]
- ccDescription :: Lens' CreateSnapshot (Maybe Text)
- ccDryRun :: Lens' CreateSnapshot (Maybe Bool)
- ccVolumeId :: Lens' CreateSnapshot Text
- snapshot :: Text -> Text -> Text -> Int -> Text -> UTCTime -> Text -> SnapshotState -> Bool -> Snapshot
- data Snapshot
- sStateMessage :: Lens' Snapshot (Maybe Text)
- sOwnerAlias :: Lens' Snapshot (Maybe Text)
- sDataEncryptionKeyId :: Lens' Snapshot (Maybe Text)
- sKMSKeyId :: Lens' Snapshot (Maybe Text)
- sTags :: Lens' Snapshot [Tag]
- sSnapshotId :: Lens' Snapshot Text
- sOwnerId :: Lens' Snapshot Text
- sVolumeId :: Lens' Snapshot Text
- sVolumeSize :: Lens' Snapshot Int
- sDescription :: Lens' Snapshot Text
- sStartTime :: Lens' Snapshot UTCTime
- sProgress :: Lens' Snapshot Text
- sState :: Lens' Snapshot SnapshotState
- sEncrypted :: Lens' Snapshot Bool
Creating a Request
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 isDryRunOperation
. Otherwise, it isUnauthorizedOperation
.ccVolumeId
- The ID of the EBS volume.
data CreateSnapshot Source #
Contains the parameters for CreateSnapshot.
See: createSnapshot
smart constructor.
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
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 theDescribeSnapshots
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 theDescribeSnapshots
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 theCopySnapshot
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.
Describes a snapshot.
See: snapshot
smart constructor.
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.
sSnapshotId :: Lens' Snapshot Text Source #
The ID of the snapshot. Each snapshot receives a unique identifier when it is created.