aws_sdk_ec2/client/create_volume.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`CreateVolume`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`availability_zone(impl Into<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::availability_zone) / [`set_availability_zone(Option<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_availability_zone):<br>required: **false**<br><p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p> <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p><br>
7 /// - [`availability_zone_id(impl Into<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::availability_zone_id) / [`set_availability_zone_id(Option<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_availability_zone_id):<br>required: **false**<br><p>The ID of the Availability Zone in which to create the volume. For example, <code>use1-az1</code>.</p> <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p><br>
8 /// - [`encrypted(bool)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::encrypted) / [`set_encrypted(Option<bool>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_encrypted):<br>required: **false**<br><p>Indicates whether the volume should be encrypted. The effect of setting the encryption state to <code>true</code> 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 <a href="https://docs.aws.amazon.com/ebs/latest/userguide/work-with-ebs-encr.html#encryption-by-default">Encryption by default</a> in the <i>Amazon EBS User Guide</i>.</p> <p>Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances">Supported instance types</a>.</p><br>
9 /// - [`iops(i32)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::iops) / [`set_iops(Option<i32>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_iops):<br>required: **false**<br><p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p> <p>The following are the supported values for each volume type:</p> <ul> <li> <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li> <li> <p><code>io1</code>: 100 - 64,000 IOPS</p></li> <li> <p><code>io2</code>: 100 - 256,000 IOPS</p></li> </ul> <p>For <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">instances built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p> <p>This parameter is required for <code>io1</code> and <code>io2</code> volumes. The default for <code>gp3</code> volumes is 3,000 IOPS. This parameter is not supported for <code>gp2</code>, <code>st1</code>, <code>sc1</code>, or <code>standard</code> volumes.</p><br>
10 /// - [`kms_key_id(impl Into<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::kms_key_id) / [`set_kms_key_id(Option<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_kms_key_id):<br>required: **false**<br><p>The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If <code>KmsKeyId</code> is specified, the encrypted state must be <code>true</code>.</p> <p>You can specify the KMS key using any of the following:</p> <ul> <li> <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li> <li> <p>Key alias. For example, alias/ExampleAlias.</p></li> <li> <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li> <li> <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li> </ul> <p>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.</p><br>
11 /// - [`outpost_arn(impl Into<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::outpost_arn) / [`set_outpost_arn(Option<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_outpost_arn):<br>required: **false**<br><p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p> <p>If you intend to use a volume with an instance running on an outpost, then you must create the volume on the same outpost as the instance. You can't use a volume created in an Amazon Web Services Region with an instance on an Amazon Web Services outpost, or the other way around.</p><br>
12 /// - [`size(i32)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::size) / [`set_size(Option<i32>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_size):<br>required: **false**<br><p>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.</p> <p>The following are the supported volumes sizes for each volume type:</p> <ul> <li> <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li> <li> <p><code>io1</code>: 4 - 16,384 GiB</p></li> <li> <p><code>io2</code>: 4 - 65,536 GiB</p></li> <li> <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li> <li> <p><code>standard</code>: 1 - 1024 GiB</p></li> </ul><br>
13 /// - [`snapshot_id(impl Into<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::snapshot_id) / [`set_snapshot_id(Option<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_snapshot_id):<br>required: **false**<br><p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p><br>
14 /// - [`volume_type(VolumeType)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::volume_type) / [`set_volume_type(Option<VolumeType>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_volume_type):<br>required: **false**<br><p>The volume type. This parameter can be one of the following values:</p> <ul> <li> <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li> <li> <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li> <li> <p>Throughput Optimized HDD: <code>st1</code></p></li> <li> <p>Cold HDD: <code>sc1</code></p></li> <li> <p>Magnetic: <code>standard</code></p></li> </ul><important> <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p> </important> <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p> <p>Default: <code>gp2</code></p><br>
15 /// - [`tag_specifications(TagSpecification)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::tag_specifications) / [`set_tag_specifications(Option<Vec::<TagSpecification>>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_tag_specifications):<br>required: **false**<br><p>The tags to apply to the volume during creation.</p><br>
16 /// - [`multi_attach_enabled(bool)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::multi_attach_enabled) / [`set_multi_attach_enabled(Option<bool>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_multi_attach_enabled):<br>required: **false**<br><p>Indicates whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">Instances built on the Nitro System</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p><br>
17 /// - [`throughput(i32)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::throughput) / [`set_throughput(Option<i32>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_throughput):<br>required: **false**<br><p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p> <p>This parameter is valid only for <code>gp3</code> volumes.</p> <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p><br>
18 /// - [`client_token(impl Into<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_client_token):<br>required: **false**<br><p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensure Idempotency</a>.</p><br>
19 /// - [`volume_initialization_rate(i32)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::volume_initialization_rate) / [`set_volume_initialization_rate(Option<i32>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_volume_initialization_rate):<br>required: **false**<br><p>Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. This is also known as <i>volume initialization</i>. Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation.</p> <p>This parameter is supported only for volumes created from snapshots. Omit this parameter if:</p> <ul> <li> <p>You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation.</p><note> <p>If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore.</p> </note></li> <li> <p>You want to create a volume that is initialized at the default rate.</p></li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html"> Initialize Amazon EBS volumes</a> in the <i>Amazon EC2 User Guide</i>.</p> <p>Valid range: 100 - 300 MiB/s</p><br>
20 /// - [`operator(OperatorRequest)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::operator) / [`set_operator(Option<OperatorRequest>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_operator):<br>required: **false**<br><p>Reserved for internal use.</p><br>
21 /// - [`dry_run(bool)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder::set_dry_run):<br>required: **false**<br><p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p><br>
22 /// - On success, responds with [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput) with field(s):
23 /// - [`availability_zone_id(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::availability_zone_id): <p>The ID of the Availability Zone for the volume.</p>
24 /// - [`outpost_arn(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::outpost_arn): <p>The Amazon Resource Name (ARN) of the Outpost.</p>
25 /// - [`iops(Option<i32>)`](crate::operation::create_volume::CreateVolumeOutput::iops): <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
26 /// - [`tags(Option<Vec::<Tag>>)`](crate::operation::create_volume::CreateVolumeOutput::tags): <p>Any tags assigned to the volume.</p>
27 /// - [`volume_type(Option<VolumeType>)`](crate::operation::create_volume::CreateVolumeOutput::volume_type): <p>The volume type.</p>
28 /// - [`fast_restored(Option<bool>)`](crate::operation::create_volume::CreateVolumeOutput::fast_restored): <note> <p>This parameter is not returned by CreateVolume.</p> </note> <p>Indicates whether the volume was created using fast snapshot restore.</p>
29 /// - [`multi_attach_enabled(Option<bool>)`](crate::operation::create_volume::CreateVolumeOutput::multi_attach_enabled): <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
30 /// - [`throughput(Option<i32>)`](crate::operation::create_volume::CreateVolumeOutput::throughput): <p>The throughput that the volume supports, in MiB/s.</p>
31 /// - [`sse_type(Option<SseType>)`](crate::operation::create_volume::CreateVolumeOutput::sse_type): <note> <p>This parameter is not returned by CreateVolume.</p> </note> <p>Reserved for future use.</p>
32 /// - [`operator(Option<OperatorResponse>)`](crate::operation::create_volume::CreateVolumeOutput::operator): <p>The service provider that manages the volume.</p>
33 /// - [`volume_initialization_rate(Option<i32>)`](crate::operation::create_volume::CreateVolumeOutput::volume_initialization_rate): <p>The Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate) specified for the volume during creation, in MiB/s. If no volume initialization rate was specified, the value is <code>null</code>.</p>
34 /// - [`volume_id(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::volume_id): <p>The ID of the volume.</p>
35 /// - [`size(Option<i32>)`](crate::operation::create_volume::CreateVolumeOutput::size): <p>The size of the volume, in GiBs.</p>
36 /// - [`snapshot_id(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::snapshot_id): <p>The snapshot from which the volume was created, if applicable.</p>
37 /// - [`availability_zone(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::availability_zone): <p>The Availability Zone for the volume.</p>
38 /// - [`state(Option<VolumeState>)`](crate::operation::create_volume::CreateVolumeOutput::state): <p>The volume state.</p>
39 /// - [`create_time(Option<DateTime>)`](crate::operation::create_volume::CreateVolumeOutput::create_time): <p>The time stamp when volume creation was initiated.</p>
40 /// - [`attachments(Option<Vec::<VolumeAttachment>>)`](crate::operation::create_volume::CreateVolumeOutput::attachments): <note> <p>This parameter is not returned by CreateVolume.</p> </note> <p>Information about the volume attachments.</p>
41 /// - [`encrypted(Option<bool>)`](crate::operation::create_volume::CreateVolumeOutput::encrypted): <p>Indicates whether the volume is encrypted.</p>
42 /// - [`kms_key_id(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::kms_key_id): <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
43 /// - On failure, responds with [`SdkError<CreateVolumeError>`](crate::operation::create_volume::CreateVolumeError)
44 pub fn create_volume(&self) -> crate::operation::create_volume::builders::CreateVolumeFluentBuilder {
45 crate::operation::create_volume::builders::CreateVolumeFluentBuilder::new(self.handle.clone())
46 }
47}