aws_sdk_ec2/operation/create_volume/_create_volume_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateVolumeInput {
6 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
7 pub availability_zone: ::std::option::Option<::std::string::String>,
8 /// <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>
9 /// <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>
10 pub encrypted: ::std::option::Option<bool>,
11 /// <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>
12 /// <p>The following are the supported values for each volume type:</p>
13 /// <ul>
14 /// <li>
15 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
16 /// <li>
17 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
18 /// <li>
19 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
20 /// </ul>
21 /// <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>
22 /// <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>
23 pub iops: ::std::option::Option<i32>,
24 /// <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>
25 /// <p>You can specify the KMS key using any of the following:</p>
26 /// <ul>
27 /// <li>
28 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
29 /// <li>
30 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
31 /// <li>
32 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
33 /// <li>
34 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
35 /// </ul>
36 /// <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>
37 pub kms_key_id: ::std::option::Option<::std::string::String>,
38 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
39 /// <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>
40 pub outpost_arn: ::std::option::Option<::std::string::String>,
41 /// <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>
42 /// <p>The following are the supported volumes sizes for each volume type:</p>
43 /// <ul>
44 /// <li>
45 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
46 /// <li>
47 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
48 /// <li>
49 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
50 /// <li>
51 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
52 /// <li>
53 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
54 /// </ul>
55 pub size: ::std::option::Option<i32>,
56 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
57 pub snapshot_id: ::std::option::Option<::std::string::String>,
58 /// <p>The volume type. This parameter can be one of the following values:</p>
59 /// <ul>
60 /// <li>
61 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
62 /// <li>
63 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
64 /// <li>
65 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
66 /// <li>
67 /// <p>Cold HDD: <code>sc1</code></p></li>
68 /// <li>
69 /// <p>Magnetic: <code>standard</code></p></li>
70 /// </ul><important>
71 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
72 /// </important>
73 /// <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>
74 /// <p>Default: <code>gp2</code></p>
75 pub volume_type: ::std::option::Option<crate::types::VolumeType>,
76 /// <p>The tags to apply to the volume during creation.</p>
77 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
78 /// <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>
79 pub multi_attach_enabled: ::std::option::Option<bool>,
80 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
81 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
82 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
83 pub throughput: ::std::option::Option<i32>,
84 /// <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>
85 pub client_token: ::std::option::Option<::std::string::String>,
86 /// <p>Reserved for internal use.</p>
87 pub operator: ::std::option::Option<crate::types::OperatorRequest>,
88 /// <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>
89 pub dry_run: ::std::option::Option<bool>,
90}
91impl CreateVolumeInput {
92 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
93 pub fn availability_zone(&self) -> ::std::option::Option<&str> {
94 self.availability_zone.as_deref()
95 }
96 /// <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>
97 /// <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>
98 pub fn encrypted(&self) -> ::std::option::Option<bool> {
99 self.encrypted
100 }
101 /// <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>
102 /// <p>The following are the supported values for each volume type:</p>
103 /// <ul>
104 /// <li>
105 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
106 /// <li>
107 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
108 /// <li>
109 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
110 /// </ul>
111 /// <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>
112 /// <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>
113 pub fn iops(&self) -> ::std::option::Option<i32> {
114 self.iops
115 }
116 /// <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>
117 /// <p>You can specify the KMS key using any of the following:</p>
118 /// <ul>
119 /// <li>
120 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
121 /// <li>
122 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
123 /// <li>
124 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
125 /// <li>
126 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
127 /// </ul>
128 /// <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>
129 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
130 self.kms_key_id.as_deref()
131 }
132 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
133 /// <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>
134 pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
135 self.outpost_arn.as_deref()
136 }
137 /// <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>
138 /// <p>The following are the supported volumes sizes for each volume type:</p>
139 /// <ul>
140 /// <li>
141 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
142 /// <li>
143 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
144 /// <li>
145 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
146 /// <li>
147 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
148 /// <li>
149 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
150 /// </ul>
151 pub fn size(&self) -> ::std::option::Option<i32> {
152 self.size
153 }
154 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
155 pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
156 self.snapshot_id.as_deref()
157 }
158 /// <p>The volume type. This parameter can be one of the following values:</p>
159 /// <ul>
160 /// <li>
161 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
162 /// <li>
163 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
164 /// <li>
165 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
166 /// <li>
167 /// <p>Cold HDD: <code>sc1</code></p></li>
168 /// <li>
169 /// <p>Magnetic: <code>standard</code></p></li>
170 /// </ul><important>
171 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
172 /// </important>
173 /// <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>
174 /// <p>Default: <code>gp2</code></p>
175 pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
176 self.volume_type.as_ref()
177 }
178 /// <p>The tags to apply to the volume during creation.</p>
179 ///
180 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
181 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
182 self.tag_specifications.as_deref().unwrap_or_default()
183 }
184 /// <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>
185 pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
186 self.multi_attach_enabled
187 }
188 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
189 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
190 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
191 pub fn throughput(&self) -> ::std::option::Option<i32> {
192 self.throughput
193 }
194 /// <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>
195 pub fn client_token(&self) -> ::std::option::Option<&str> {
196 self.client_token.as_deref()
197 }
198 /// <p>Reserved for internal use.</p>
199 pub fn operator(&self) -> ::std::option::Option<&crate::types::OperatorRequest> {
200 self.operator.as_ref()
201 }
202 /// <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>
203 pub fn dry_run(&self) -> ::std::option::Option<bool> {
204 self.dry_run
205 }
206}
207impl CreateVolumeInput {
208 /// Creates a new builder-style object to manufacture [`CreateVolumeInput`](crate::operation::create_volume::CreateVolumeInput).
209 pub fn builder() -> crate::operation::create_volume::builders::CreateVolumeInputBuilder {
210 crate::operation::create_volume::builders::CreateVolumeInputBuilder::default()
211 }
212}
213
214/// A builder for [`CreateVolumeInput`](crate::operation::create_volume::CreateVolumeInput).
215#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
216#[non_exhaustive]
217pub struct CreateVolumeInputBuilder {
218 pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
219 pub(crate) encrypted: ::std::option::Option<bool>,
220 pub(crate) iops: ::std::option::Option<i32>,
221 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
222 pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
223 pub(crate) size: ::std::option::Option<i32>,
224 pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
225 pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
226 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
227 pub(crate) multi_attach_enabled: ::std::option::Option<bool>,
228 pub(crate) throughput: ::std::option::Option<i32>,
229 pub(crate) client_token: ::std::option::Option<::std::string::String>,
230 pub(crate) operator: ::std::option::Option<crate::types::OperatorRequest>,
231 pub(crate) dry_run: ::std::option::Option<bool>,
232}
233impl CreateVolumeInputBuilder {
234 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
235 /// This field is required.
236 pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237 self.availability_zone = ::std::option::Option::Some(input.into());
238 self
239 }
240 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
241 pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242 self.availability_zone = input;
243 self
244 }
245 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
246 pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
247 &self.availability_zone
248 }
249 /// <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>
250 /// <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>
251 pub fn encrypted(mut self, input: bool) -> Self {
252 self.encrypted = ::std::option::Option::Some(input);
253 self
254 }
255 /// <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>
256 /// <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>
257 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
258 self.encrypted = input;
259 self
260 }
261 /// <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>
262 /// <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>
263 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
264 &self.encrypted
265 }
266 /// <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>
267 /// <p>The following are the supported values for each volume type:</p>
268 /// <ul>
269 /// <li>
270 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
271 /// <li>
272 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
273 /// <li>
274 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
275 /// </ul>
276 /// <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>
277 /// <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>
278 pub fn iops(mut self, input: i32) -> Self {
279 self.iops = ::std::option::Option::Some(input);
280 self
281 }
282 /// <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>
283 /// <p>The following are the supported values for each volume type:</p>
284 /// <ul>
285 /// <li>
286 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
287 /// <li>
288 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
289 /// <li>
290 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
291 /// </ul>
292 /// <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>
293 /// <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>
294 pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
295 self.iops = input;
296 self
297 }
298 /// <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>
299 /// <p>The following are the supported values for each volume type:</p>
300 /// <ul>
301 /// <li>
302 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
303 /// <li>
304 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
305 /// <li>
306 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
307 /// </ul>
308 /// <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>
309 /// <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>
310 pub fn get_iops(&self) -> &::std::option::Option<i32> {
311 &self.iops
312 }
313 /// <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>
314 /// <p>You can specify the KMS key using any of the following:</p>
315 /// <ul>
316 /// <li>
317 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
318 /// <li>
319 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
320 /// <li>
321 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
322 /// <li>
323 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
324 /// </ul>
325 /// <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>
326 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
327 self.kms_key_id = ::std::option::Option::Some(input.into());
328 self
329 }
330 /// <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>
331 /// <p>You can specify the KMS key using any of the following:</p>
332 /// <ul>
333 /// <li>
334 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
335 /// <li>
336 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
337 /// <li>
338 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
339 /// <li>
340 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
341 /// </ul>
342 /// <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>
343 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
344 self.kms_key_id = input;
345 self
346 }
347 /// <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>
348 /// <p>You can specify the KMS key using any of the following:</p>
349 /// <ul>
350 /// <li>
351 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
352 /// <li>
353 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
354 /// <li>
355 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
356 /// <li>
357 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
358 /// </ul>
359 /// <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>
360 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
361 &self.kms_key_id
362 }
363 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
364 /// <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>
365 pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
366 self.outpost_arn = ::std::option::Option::Some(input.into());
367 self
368 }
369 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
370 /// <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>
371 pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
372 self.outpost_arn = input;
373 self
374 }
375 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
376 /// <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>
377 pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
378 &self.outpost_arn
379 }
380 /// <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>
381 /// <p>The following are the supported volumes sizes for each volume type:</p>
382 /// <ul>
383 /// <li>
384 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
385 /// <li>
386 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
387 /// <li>
388 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
389 /// <li>
390 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
391 /// <li>
392 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
393 /// </ul>
394 pub fn size(mut self, input: i32) -> Self {
395 self.size = ::std::option::Option::Some(input);
396 self
397 }
398 /// <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>
399 /// <p>The following are the supported volumes sizes for each volume type:</p>
400 /// <ul>
401 /// <li>
402 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
403 /// <li>
404 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
405 /// <li>
406 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
407 /// <li>
408 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
409 /// <li>
410 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
411 /// </ul>
412 pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
413 self.size = input;
414 self
415 }
416 /// <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>
417 /// <p>The following are the supported volumes sizes for each volume type:</p>
418 /// <ul>
419 /// <li>
420 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
421 /// <li>
422 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
423 /// <li>
424 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
425 /// <li>
426 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
427 /// <li>
428 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
429 /// </ul>
430 pub fn get_size(&self) -> &::std::option::Option<i32> {
431 &self.size
432 }
433 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
434 pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
435 self.snapshot_id = ::std::option::Option::Some(input.into());
436 self
437 }
438 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
439 pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
440 self.snapshot_id = input;
441 self
442 }
443 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
444 pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
445 &self.snapshot_id
446 }
447 /// <p>The volume type. This parameter can be one of the following values:</p>
448 /// <ul>
449 /// <li>
450 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
451 /// <li>
452 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
453 /// <li>
454 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
455 /// <li>
456 /// <p>Cold HDD: <code>sc1</code></p></li>
457 /// <li>
458 /// <p>Magnetic: <code>standard</code></p></li>
459 /// </ul><important>
460 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
461 /// </important>
462 /// <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>
463 /// <p>Default: <code>gp2</code></p>
464 pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
465 self.volume_type = ::std::option::Option::Some(input);
466 self
467 }
468 /// <p>The volume type. This parameter can be one of the following values:</p>
469 /// <ul>
470 /// <li>
471 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
472 /// <li>
473 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
474 /// <li>
475 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
476 /// <li>
477 /// <p>Cold HDD: <code>sc1</code></p></li>
478 /// <li>
479 /// <p>Magnetic: <code>standard</code></p></li>
480 /// </ul><important>
481 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
482 /// </important>
483 /// <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>
484 /// <p>Default: <code>gp2</code></p>
485 pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
486 self.volume_type = input;
487 self
488 }
489 /// <p>The volume type. This parameter can be one of the following values:</p>
490 /// <ul>
491 /// <li>
492 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
493 /// <li>
494 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
495 /// <li>
496 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
497 /// <li>
498 /// <p>Cold HDD: <code>sc1</code></p></li>
499 /// <li>
500 /// <p>Magnetic: <code>standard</code></p></li>
501 /// </ul><important>
502 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
503 /// </important>
504 /// <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>
505 /// <p>Default: <code>gp2</code></p>
506 pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
507 &self.volume_type
508 }
509 /// Appends an item to `tag_specifications`.
510 ///
511 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
512 ///
513 /// <p>The tags to apply to the volume during creation.</p>
514 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
515 let mut v = self.tag_specifications.unwrap_or_default();
516 v.push(input);
517 self.tag_specifications = ::std::option::Option::Some(v);
518 self
519 }
520 /// <p>The tags to apply to the volume during creation.</p>
521 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
522 self.tag_specifications = input;
523 self
524 }
525 /// <p>The tags to apply to the volume during creation.</p>
526 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
527 &self.tag_specifications
528 }
529 /// <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>
530 pub fn multi_attach_enabled(mut self, input: bool) -> Self {
531 self.multi_attach_enabled = ::std::option::Option::Some(input);
532 self
533 }
534 /// <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>
535 pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
536 self.multi_attach_enabled = input;
537 self
538 }
539 /// <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>
540 pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
541 &self.multi_attach_enabled
542 }
543 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
544 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
545 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
546 pub fn throughput(mut self, input: i32) -> Self {
547 self.throughput = ::std::option::Option::Some(input);
548 self
549 }
550 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
551 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
552 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
553 pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
554 self.throughput = input;
555 self
556 }
557 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
558 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
559 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
560 pub fn get_throughput(&self) -> &::std::option::Option<i32> {
561 &self.throughput
562 }
563 /// <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>
564 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
565 self.client_token = ::std::option::Option::Some(input.into());
566 self
567 }
568 /// <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>
569 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
570 self.client_token = input;
571 self
572 }
573 /// <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>
574 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
575 &self.client_token
576 }
577 /// <p>Reserved for internal use.</p>
578 pub fn operator(mut self, input: crate::types::OperatorRequest) -> Self {
579 self.operator = ::std::option::Option::Some(input);
580 self
581 }
582 /// <p>Reserved for internal use.</p>
583 pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorRequest>) -> Self {
584 self.operator = input;
585 self
586 }
587 /// <p>Reserved for internal use.</p>
588 pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorRequest> {
589 &self.operator
590 }
591 /// <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>
592 pub fn dry_run(mut self, input: bool) -> Self {
593 self.dry_run = ::std::option::Option::Some(input);
594 self
595 }
596 /// <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>
597 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
598 self.dry_run = input;
599 self
600 }
601 /// <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>
602 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
603 &self.dry_run
604 }
605 /// Consumes the builder and constructs a [`CreateVolumeInput`](crate::operation::create_volume::CreateVolumeInput).
606 pub fn build(
607 self,
608 ) -> ::std::result::Result<crate::operation::create_volume::CreateVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
609 ::std::result::Result::Ok(crate::operation::create_volume::CreateVolumeInput {
610 availability_zone: self.availability_zone,
611 encrypted: self.encrypted,
612 iops: self.iops,
613 kms_key_id: self.kms_key_id,
614 outpost_arn: self.outpost_arn,
615 size: self.size,
616 snapshot_id: self.snapshot_id,
617 volume_type: self.volume_type,
618 tag_specifications: self.tag_specifications,
619 multi_attach_enabled: self.multi_attach_enabled,
620 throughput: self.throughput,
621 client_token: self.client_token,
622 operator: self.operator,
623 dry_run: self.dry_run,
624 })
625 }
626}