Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Creates an EBS volume that can be attached to an instance in the same Availability Zone.
You can create a new empty volume or restore a volume from an EBS snapshot. Any Amazon Web Services Marketplace product codes from the snapshot are propagated to the volume.
You can create encrypted volumes. Encrypted volumes must be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.
You can tag your volumes during creation. For more information, see Tag your Amazon EC2 resources in the Amazon Elastic Compute Cloud User Guide.
For more information, see Create an Amazon EBS volume in the Amazon Elastic Compute Cloud User Guide.
Synopsis
- data CreateVolume = CreateVolume' {
- clientToken :: Maybe Text
- dryRun :: Maybe Bool
- encrypted :: Maybe Bool
- iops :: Maybe Int
- kmsKeyId :: Maybe Text
- multiAttachEnabled :: Maybe Bool
- outpostArn :: Maybe Text
- size :: Maybe Int
- snapshotId :: Maybe Text
- tagSpecifications :: Maybe [TagSpecification]
- throughput :: Maybe Int
- volumeType :: Maybe VolumeType
- availabilityZone :: Text
- newCreateVolume :: Text -> CreateVolume
- createVolume_clientToken :: Lens' CreateVolume (Maybe Text)
- createVolume_dryRun :: Lens' CreateVolume (Maybe Bool)
- createVolume_encrypted :: Lens' CreateVolume (Maybe Bool)
- createVolume_iops :: Lens' CreateVolume (Maybe Int)
- createVolume_kmsKeyId :: Lens' CreateVolume (Maybe Text)
- createVolume_multiAttachEnabled :: Lens' CreateVolume (Maybe Bool)
- createVolume_outpostArn :: Lens' CreateVolume (Maybe Text)
- createVolume_size :: Lens' CreateVolume (Maybe Int)
- createVolume_snapshotId :: Lens' CreateVolume (Maybe Text)
- createVolume_tagSpecifications :: Lens' CreateVolume (Maybe [TagSpecification])
- createVolume_throughput :: Lens' CreateVolume (Maybe Int)
- createVolume_volumeType :: Lens' CreateVolume (Maybe VolumeType)
- createVolume_availabilityZone :: Lens' CreateVolume Text
- data Volume = Volume' {
- attachments :: Maybe [VolumeAttachment]
- fastRestored :: Maybe Bool
- iops :: Maybe Int
- kmsKeyId :: Maybe Text
- multiAttachEnabled :: Maybe Bool
- outpostArn :: Maybe Text
- tags :: Maybe [Tag]
- throughput :: Maybe Int
- availabilityZone :: Text
- createTime :: ISO8601
- encrypted :: Bool
- size :: Int
- snapshotId :: Text
- state :: VolumeState
- volumeId :: Text
- volumeType :: VolumeType
- newVolume :: Text -> UTCTime -> Bool -> Int -> Text -> VolumeState -> Text -> VolumeType -> Volume
- volume_attachments :: Lens' Volume (Maybe [VolumeAttachment])
- volume_fastRestored :: Lens' Volume (Maybe Bool)
- volume_iops :: Lens' Volume (Maybe Int)
- volume_kmsKeyId :: Lens' Volume (Maybe Text)
- volume_multiAttachEnabled :: Lens' Volume (Maybe Bool)
- volume_outpostArn :: Lens' Volume (Maybe Text)
- volume_tags :: Lens' Volume (Maybe [Tag])
- volume_throughput :: Lens' Volume (Maybe Int)
- volume_availabilityZone :: Lens' Volume Text
- volume_createTime :: Lens' Volume UTCTime
- volume_encrypted :: Lens' Volume Bool
- volume_size :: Lens' Volume Int
- volume_snapshotId :: Lens' Volume Text
- volume_state :: Lens' Volume VolumeState
- volume_volumeId :: Lens' Volume Text
- volume_volumeType :: Lens' Volume VolumeType
Creating a Request
data CreateVolume Source #
See: newCreateVolume
smart constructor.
CreateVolume' | |
|
Instances
Create a value of CreateVolume
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
CreateVolume
, createVolume_clientToken
- Unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. For more information, see
Ensure Idempotency.
$sel:dryRun:CreateVolume'
, createVolume_dryRun
- 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
.
CreateVolume
, createVolume_encrypted
- Indicates whether the volume should be encrypted. The effect of setting
the encryption state to true
depends on the volume origin (new or from
a snapshot), starting encryption state, ownership, and whether
encryption by default is enabled. For more information, see
Encryption by default
in the Amazon Elastic Compute Cloud User Guide.
Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types.
CreateVolume
, createVolume_iops
- The number of I/O operations per second (IOPS). For gp3
, io1
, and
io2
volumes, this represents the number of IOPS that are provisioned
for the volume. For gp2
volumes, this represents the baseline
performance of the volume and the rate at which the volume accumulates
I/O credits for bursting.
The following are the supported values for each volume type:
gp3
: 3,000-16,000 IOPSio1
: 100-64,000 IOPSio2
: 100-64,000 IOPS
io1
and io2
volumes support up to 64,000 IOPS only on
Instances built on the Nitro System.
Other instance families support performance up to 32,000 IOPS.
This parameter is required for io1
and io2
volumes. The default for
gp3
volumes is 3,000 IOPS. This parameter is not supported for gp2
,
st1
, sc1
, or standard
volumes.
CreateVolume
, createVolume_kmsKeyId
- The identifier of the Key Management Service (KMS) KMS key to use for
Amazon EBS encryption. If this parameter is not specified, your KMS key
for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state
must be true
.
You can specify the KMS key using any of the following:
- Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
- Key alias. For example, alias/ExampleAlias.
- Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
- Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.
CreateVolume
, createVolume_multiAttachEnabled
- Indicates whether to enable Amazon EBS Multi-Attach. If you enable
Multi-Attach, you can attach the volume to up to 16
Instances built on the Nitro System
in the same Availability Zone. This parameter is supported with io1
and io2
volumes only. For more information, see
Amazon EBS Multi-Attach
in the Amazon Elastic Compute Cloud User Guide.
CreateVolume
, createVolume_outpostArn
- The Amazon Resource Name (ARN) of the Outpost.
CreateVolume
, createVolume_size
- The size of the volume, in GiBs. You must specify either a snapshot ID
or a volume size. If you specify a snapshot, the default is the snapshot
size. You can specify a volume size that is equal to or larger than the
snapshot size.
The following are the supported volumes sizes for each volume type:
gp2
andgp3
: 1-16,384io1
andio2
: 4-16,384st1
andsc1
: 125-16,384standard
: 1-1,024
CreateVolume
, createVolume_snapshotId
- The snapshot from which to create the volume. You must specify either a
snapshot ID or a volume size.
CreateVolume
, createVolume_tagSpecifications
- The tags to apply to the volume during creation.
CreateVolume
, createVolume_throughput
- The throughput to provision for a volume, with a maximum of 1,000
MiB/s.
This parameter is valid only for gp3
volumes.
Valid Range: Minimum value of 125. Maximum value of 1000.
CreateVolume
, createVolume_volumeType
- The volume type. This parameter can be one of the following values:
- General Purpose SSD:
gp2
|gp3
- Provisioned IOPS SSD:
io1
|io2
- Throughput Optimized HDD:
st1
- Cold HDD:
sc1
- Magnetic:
standard
For more information, see Amazon EBS volume types in the Amazon Elastic Compute Cloud User Guide.
Default: gp2
CreateVolume
, createVolume_availabilityZone
- The Availability Zone in which to create the volume.
Request Lenses
createVolume_clientToken :: Lens' CreateVolume (Maybe Text) Source #
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
createVolume_dryRun :: Lens' CreateVolume (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
.
createVolume_encrypted :: Lens' CreateVolume (Maybe Bool) Source #
Indicates whether the volume should be encrypted. The effect of setting
the encryption state to true
depends on the volume origin (new or from
a snapshot), starting encryption state, ownership, and whether
encryption by default is enabled. For more information, see
Encryption by default
in the Amazon Elastic Compute Cloud User Guide.
Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types.
createVolume_iops :: Lens' CreateVolume (Maybe Int) Source #
The number of I/O operations per second (IOPS). For gp3
, io1
, and
io2
volumes, this represents the number of IOPS that are provisioned
for the volume. For gp2
volumes, this represents the baseline
performance of the volume and the rate at which the volume accumulates
I/O credits for bursting.
The following are the supported values for each volume type:
gp3
: 3,000-16,000 IOPSio1
: 100-64,000 IOPSio2
: 100-64,000 IOPS
io1
and io2
volumes support up to 64,000 IOPS only on
Instances built on the Nitro System.
Other instance families support performance up to 32,000 IOPS.
This parameter is required for io1
and io2
volumes. The default for
gp3
volumes is 3,000 IOPS. This parameter is not supported for gp2
,
st1
, sc1
, or standard
volumes.
createVolume_kmsKeyId :: Lens' CreateVolume (Maybe Text) Source #
The identifier of the Key Management Service (KMS) KMS key to use for
Amazon EBS encryption. If this parameter is not specified, your KMS key
for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state
must be true
.
You can specify the KMS key using any of the following:
- Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
- Key alias. For example, alias/ExampleAlias.
- Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
- Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.
createVolume_multiAttachEnabled :: Lens' CreateVolume (Maybe Bool) Source #
Indicates whether to enable Amazon EBS Multi-Attach. If you enable
Multi-Attach, you can attach the volume to up to 16
Instances built on the Nitro System
in the same Availability Zone. This parameter is supported with io1
and io2
volumes only. For more information, see
Amazon EBS Multi-Attach
in the Amazon Elastic Compute Cloud User Guide.
createVolume_outpostArn :: Lens' CreateVolume (Maybe Text) Source #
The Amazon Resource Name (ARN) of the Outpost.
createVolume_size :: Lens' CreateVolume (Maybe Int) Source #
The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.
The following are the supported volumes sizes for each volume type:
gp2
andgp3
: 1-16,384io1
andio2
: 4-16,384st1
andsc1
: 125-16,384standard
: 1-1,024
createVolume_snapshotId :: Lens' CreateVolume (Maybe Text) Source #
The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.
createVolume_tagSpecifications :: Lens' CreateVolume (Maybe [TagSpecification]) Source #
The tags to apply to the volume during creation.
createVolume_throughput :: Lens' CreateVolume (Maybe Int) Source #
The throughput to provision for a volume, with a maximum of 1,000 MiB/s.
This parameter is valid only for gp3
volumes.
Valid Range: Minimum value of 125. Maximum value of 1000.
createVolume_volumeType :: Lens' CreateVolume (Maybe VolumeType) Source #
The volume type. This parameter can be one of the following values:
- General Purpose SSD:
gp2
|gp3
- Provisioned IOPS SSD:
io1
|io2
- Throughput Optimized HDD:
st1
- Cold HDD:
sc1
- Magnetic:
standard
For more information, see Amazon EBS volume types in the Amazon Elastic Compute Cloud User Guide.
Default: gp2
createVolume_availabilityZone :: Lens' CreateVolume Text Source #
The Availability Zone in which to create the volume.
Destructuring the Response
Describes a volume.
See: newVolume
smart constructor.
Volume' | |
|
Instances
:: Text | |
-> UTCTime | |
-> Bool | |
-> Int | |
-> Text | |
-> VolumeState | |
-> Text | |
-> VolumeType | |
-> Volume |
Create a value of Volume
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:attachments:Volume'
, volume_attachments
- Information about the volume attachments.
$sel:fastRestored:Volume'
, volume_fastRestored
- Indicates whether the volume was created using fast snapshot restore.
$sel:iops:Volume'
, volume_iops
- The number of I/O operations per second (IOPS). For gp3
, io1
, and
io2
volumes, this represents the number of IOPS that are provisioned
for the volume. For gp2
volumes, this represents the baseline
performance of the volume and the rate at which the volume accumulates
I/O credits for bursting.
$sel:kmsKeyId:Volume'
, volume_kmsKeyId
- The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS
key that was used to protect the volume encryption key for the volume.
$sel:multiAttachEnabled:Volume'
, volume_multiAttachEnabled
- Indicates whether Amazon EBS Multi-Attach is enabled.
$sel:outpostArn:Volume'
, volume_outpostArn
- The Amazon Resource Name (ARN) of the Outpost.
$sel:tags:Volume'
, volume_tags
- Any tags assigned to the volume.
$sel:throughput:Volume'
, volume_throughput
- The throughput that the volume supports, in MiB/s.
$sel:availabilityZone:Volume'
, volume_availabilityZone
- The Availability Zone for the volume.
$sel:createTime:Volume'
, volume_createTime
- The time stamp when volume creation was initiated.
$sel:encrypted:Volume'
, volume_encrypted
- Indicates whether the volume is encrypted.
$sel:size:Volume'
, volume_size
- The size of the volume, in GiBs.
$sel:snapshotId:Volume'
, volume_snapshotId
- The snapshot from which the volume was created, if applicable.
Volume
, volume_state
- The volume state.
Volume
, volume_volumeId
- The ID of the volume.
$sel:volumeType:Volume'
, volume_volumeType
- The volume type.
Response Lenses
volume_attachments :: Lens' Volume (Maybe [VolumeAttachment]) Source #
Information about the volume attachments.
volume_fastRestored :: Lens' Volume (Maybe Bool) Source #
Indicates whether the volume was created using fast snapshot restore.
volume_iops :: Lens' Volume (Maybe Int) Source #
The number of I/O operations per second (IOPS). For gp3
, io1
, and
io2
volumes, this represents the number of IOPS that are provisioned
for the volume. For gp2
volumes, this represents the baseline
performance of the volume and the rate at which the volume accumulates
I/O credits for bursting.
volume_kmsKeyId :: Lens' Volume (Maybe Text) Source #
The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key that was used to protect the volume encryption key for the volume.
volume_multiAttachEnabled :: Lens' Volume (Maybe Bool) Source #
Indicates whether Amazon EBS Multi-Attach is enabled.
volume_outpostArn :: Lens' Volume (Maybe Text) Source #
The Amazon Resource Name (ARN) of the Outpost.
volume_throughput :: Lens' Volume (Maybe Int) Source #
The throughput that the volume supports, in MiB/s.
volume_createTime :: Lens' Volume UTCTime Source #
The time stamp when volume creation was initiated.
volume_snapshotId :: Lens' Volume Text Source #
The snapshot from which the volume was created, if applicable.
volume_state :: Lens' Volume VolumeState Source #
The volume state.
volume_volumeType :: Lens' Volume VolumeType Source #
The volume type.