1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`CreateVolume`](crate::operation::create_volume::builders::CreateVolumeFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`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: **true**<br><p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p><br>
    ///   - [`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/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default">Encryption by default</a> in the <i>Amazon Elastic Compute Cloud 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/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances">Supported instance types</a>.</p><br>
    ///   - [`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-64,000 IOPS</p> </li>  </ul>  <p> <code>io1</code> and <code>io2</code> volumes support up to 64,000 IOPS only on <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances">Instances built on the Nitro System</a>. Other instance families support 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>
    ///   - [`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 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 <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>
    ///   - [`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.</p><br>
    ///   - [`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</p> </li>   <li> <p> <code>io1</code> and <code>io2</code>: 4-16,384</p> </li>   <li> <p> <code>st1</code> and <code>sc1</code>: 125-16,384</p> </li>   <li> <p> <code>standard</code>: 1-1,024</p> </li>  </ul><br>
    ///   - [`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>
    ///   - [`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/AWSEC2/latest/UserGuide/EBSVolumeTypes.html">Amazon EBS volume types</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>  <p>Default: <code>gp2</code> </p><br>
    ///   - [`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>
    ///   - [`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>
    ///   - [`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/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances">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/AWSEC2/latest/UserGuide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p><br>
    ///   - [`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>
    ///   - [`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/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensure Idempotency</a>.</p><br>
    /// - On success, responds with [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput) with field(s):
    ///   - [`attachments(Option<Vec::<VolumeAttachment>>)`](crate::operation::create_volume::CreateVolumeOutput::attachments): <p>Information about the volume attachments.</p>
    ///   - [`availability_zone(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::availability_zone): <p>The Availability Zone for the volume.</p>
    ///   - [`create_time(Option<DateTime>)`](crate::operation::create_volume::CreateVolumeOutput::create_time): <p>The time stamp when volume creation was initiated.</p>
    ///   - [`encrypted(Option<bool>)`](crate::operation::create_volume::CreateVolumeOutput::encrypted): <p>Indicates whether the volume is encrypted.</p>
    ///   - [`kms_key_id(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::kms_key_id): <p>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.</p>
    ///   - [`outpost_arn(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::outpost_arn): <p>The Amazon Resource Name (ARN) of the Outpost.</p>
    ///   - [`size(Option<i32>)`](crate::operation::create_volume::CreateVolumeOutput::size): <p>The size of the volume, in GiBs.</p>
    ///   - [`snapshot_id(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::snapshot_id): <p>The snapshot from which the volume was created, if applicable.</p>
    ///   - [`state(Option<VolumeState>)`](crate::operation::create_volume::CreateVolumeOutput::state): <p>The volume state.</p>
    ///   - [`volume_id(Option<String>)`](crate::operation::create_volume::CreateVolumeOutput::volume_id): <p>The ID of the volume.</p>
    ///   - [`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>
    ///   - [`tags(Option<Vec::<Tag>>)`](crate::operation::create_volume::CreateVolumeOutput::tags): <p>Any tags assigned to the volume.</p>
    ///   - [`volume_type(Option<VolumeType>)`](crate::operation::create_volume::CreateVolumeOutput::volume_type): <p>The volume type.</p>
    ///   - [`fast_restored(Option<bool>)`](crate::operation::create_volume::CreateVolumeOutput::fast_restored): <p>Indicates whether the volume was created using fast snapshot restore.</p>
    ///   - [`multi_attach_enabled(Option<bool>)`](crate::operation::create_volume::CreateVolumeOutput::multi_attach_enabled): <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
    ///   - [`throughput(Option<i32>)`](crate::operation::create_volume::CreateVolumeOutput::throughput): <p>The throughput that the volume supports, in MiB/s.</p>
    ///   - [`sse_type(Option<SseType>)`](crate::operation::create_volume::CreateVolumeOutput::sse_type): <p>Reserved for future use.</p>
    /// - On failure, responds with [`SdkError<CreateVolumeError>`](crate::operation::create_volume::CreateVolumeError)
    pub fn create_volume(&self) -> crate::operation::create_volume::builders::CreateVolumeFluentBuilder {
        crate::operation::create_volume::builders::CreateVolumeFluentBuilder::new(self.handle.clone())
    }
}