aws_sdk_ec2/operation/create_volume/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_volume::_create_volume_output::CreateVolumeOutputBuilder;
3
4pub use crate::operation::create_volume::_create_volume_input::CreateVolumeInputBuilder;
5
6impl crate::operation::create_volume::builders::CreateVolumeInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_volume::CreateVolumeOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_volume::CreateVolumeError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_volume();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateVolume`.
24///
25/// <p>Creates an EBS volume that can be attached to an instance in the same Availability Zone.</p>
26/// <p>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.</p>
27/// <p>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 <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a> in the <i>Amazon EBS User Guide</i>.</p>
28/// <p>You can tag your volumes during creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">Tag your Amazon EC2 resources</a> in the <i>Amazon EC2 User Guide</i>.</p>
29/// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-creating-volume.html">Create an Amazon EBS volume</a> in the <i>Amazon EBS User Guide</i>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CreateVolumeFluentBuilder {
32 handle: ::std::sync::Arc<crate::client::Handle>,
33 inner: crate::operation::create_volume::builders::CreateVolumeInputBuilder,
34 config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37 crate::client::customize::internal::CustomizableSend<
38 crate::operation::create_volume::CreateVolumeOutput,
39 crate::operation::create_volume::CreateVolumeError,
40 > for CreateVolumeFluentBuilder
41{
42 fn send(
43 self,
44 config_override: crate::config::Builder,
45 ) -> crate::client::customize::internal::BoxFuture<
46 crate::client::customize::internal::SendResult<
47 crate::operation::create_volume::CreateVolumeOutput,
48 crate::operation::create_volume::CreateVolumeError,
49 >,
50 > {
51 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52 }
53}
54impl CreateVolumeFluentBuilder {
55 /// Creates a new `CreateVolumeFluentBuilder`.
56 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57 Self {
58 handle,
59 inner: ::std::default::Default::default(),
60 config_override: ::std::option::Option::None,
61 }
62 }
63 /// Access the CreateVolume as a reference.
64 pub fn as_input(&self) -> &crate::operation::create_volume::builders::CreateVolumeInputBuilder {
65 &self.inner
66 }
67 /// Sends the request and returns the response.
68 ///
69 /// If an error occurs, an `SdkError` will be returned with additional details that
70 /// can be matched against.
71 ///
72 /// By default, any retryable failures will be retried twice. Retry behavior
73 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74 /// set when configuring the client.
75 pub async fn send(
76 self,
77 ) -> ::std::result::Result<
78 crate::operation::create_volume::CreateVolumeOutput,
79 ::aws_smithy_runtime_api::client::result::SdkError<
80 crate::operation::create_volume::CreateVolumeError,
81 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82 >,
83 > {
84 let input = self
85 .inner
86 .build()
87 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88 let runtime_plugins = crate::operation::create_volume::CreateVolume::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::create_volume::CreateVolume::orchestrate(&runtime_plugins, input).await
94 }
95
96 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97 pub fn customize(
98 self,
99 ) -> crate::client::customize::CustomizableOperation<
100 crate::operation::create_volume::CreateVolumeOutput,
101 crate::operation::create_volume::CreateVolumeError,
102 Self,
103 > {
104 crate::client::customize::CustomizableOperation::new(self)
105 }
106 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107 self.set_config_override(::std::option::Option::Some(config_override.into()));
108 self
109 }
110
111 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112 self.config_override = config_override;
113 self
114 }
115 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
116 /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p>
117 pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.availability_zone(input.into());
119 self
120 }
121 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
122 /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p>
123 pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.inner = self.inner.set_availability_zone(input);
125 self
126 }
127 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>us-east-1a</code>.</p>
128 /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p>
129 pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
130 self.inner.get_availability_zone()
131 }
132 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>use1-az1</code>.</p>
133 /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p>
134 pub fn availability_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.availability_zone_id(input.into());
136 self
137 }
138 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>use1-az1</code>.</p>
139 /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p>
140 pub fn set_availability_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_availability_zone_id(input);
142 self
143 }
144 /// <p>The ID of the Availability Zone in which to create the volume. For example, <code>use1-az1</code>.</p>
145 /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified, but not both.</p>
146 pub fn get_availability_zone_id(&self) -> &::std::option::Option<::std::string::String> {
147 self.inner.get_availability_zone_id()
148 }
149 /// <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>
150 /// <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>
151 pub fn encrypted(mut self, input: bool) -> Self {
152 self.inner = self.inner.encrypted(input);
153 self
154 }
155 /// <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>
156 /// <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>
157 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
158 self.inner = self.inner.set_encrypted(input);
159 self
160 }
161 /// <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>
162 /// <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>
163 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
164 self.inner.get_encrypted()
165 }
166 /// <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>
167 /// <p>The following are the supported values for each volume type:</p>
168 /// <ul>
169 /// <li>
170 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
171 /// <li>
172 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
173 /// <li>
174 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
175 /// </ul>
176 /// <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>
177 /// <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>
178 pub fn iops(mut self, input: i32) -> Self {
179 self.inner = self.inner.iops(input);
180 self
181 }
182 /// <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>
183 /// <p>The following are the supported values for each volume type:</p>
184 /// <ul>
185 /// <li>
186 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
187 /// <li>
188 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
189 /// <li>
190 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
191 /// </ul>
192 /// <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>
193 /// <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>
194 pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
195 self.inner = self.inner.set_iops(input);
196 self
197 }
198 /// <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>
199 /// <p>The following are the supported values for each volume type:</p>
200 /// <ul>
201 /// <li>
202 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
203 /// <li>
204 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
205 /// <li>
206 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
207 /// </ul>
208 /// <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>
209 /// <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>
210 pub fn get_iops(&self) -> &::std::option::Option<i32> {
211 self.inner.get_iops()
212 }
213 /// <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>
214 /// <p>You can specify the KMS key using any of the following:</p>
215 /// <ul>
216 /// <li>
217 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
218 /// <li>
219 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
220 /// <li>
221 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
222 /// <li>
223 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
224 /// </ul>
225 /// <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>
226 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227 self.inner = self.inner.kms_key_id(input.into());
228 self
229 }
230 /// <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>
231 /// <p>You can specify the KMS key using any of the following:</p>
232 /// <ul>
233 /// <li>
234 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
235 /// <li>
236 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
237 /// <li>
238 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
239 /// <li>
240 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
241 /// </ul>
242 /// <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>
243 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244 self.inner = self.inner.set_kms_key_id(input);
245 self
246 }
247 /// <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>
248 /// <p>You can specify the KMS key using any of the following:</p>
249 /// <ul>
250 /// <li>
251 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
252 /// <li>
253 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
254 /// <li>
255 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
256 /// <li>
257 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
258 /// </ul>
259 /// <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>
260 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
261 self.inner.get_kms_key_id()
262 }
263 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
264 /// <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>
265 pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266 self.inner = self.inner.outpost_arn(input.into());
267 self
268 }
269 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
270 /// <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>
271 pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272 self.inner = self.inner.set_outpost_arn(input);
273 self
274 }
275 /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the volume.</p>
276 /// <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>
277 pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
278 self.inner.get_outpost_arn()
279 }
280 /// <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>
281 /// <p>The following are the supported volumes sizes for each volume type:</p>
282 /// <ul>
283 /// <li>
284 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
285 /// <li>
286 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
287 /// <li>
288 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
289 /// <li>
290 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
291 /// <li>
292 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
293 /// </ul>
294 pub fn size(mut self, input: i32) -> Self {
295 self.inner = self.inner.size(input);
296 self
297 }
298 /// <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>
299 /// <p>The following are the supported volumes sizes for each volume type:</p>
300 /// <ul>
301 /// <li>
302 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
303 /// <li>
304 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
305 /// <li>
306 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
307 /// <li>
308 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
309 /// <li>
310 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
311 /// </ul>
312 pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
313 self.inner = self.inner.set_size(input);
314 self
315 }
316 /// <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>
317 /// <p>The following are the supported volumes sizes for each volume type:</p>
318 /// <ul>
319 /// <li>
320 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
321 /// <li>
322 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
323 /// <li>
324 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
325 /// <li>
326 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
327 /// <li>
328 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
329 /// </ul>
330 pub fn get_size(&self) -> &::std::option::Option<i32> {
331 self.inner.get_size()
332 }
333 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
334 pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
335 self.inner = self.inner.snapshot_id(input.into());
336 self
337 }
338 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
339 pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
340 self.inner = self.inner.set_snapshot_id(input);
341 self
342 }
343 /// <p>The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.</p>
344 pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
345 self.inner.get_snapshot_id()
346 }
347 /// <p>The volume type. This parameter can be one of the following values:</p>
348 /// <ul>
349 /// <li>
350 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
351 /// <li>
352 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
353 /// <li>
354 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
355 /// <li>
356 /// <p>Cold HDD: <code>sc1</code></p></li>
357 /// <li>
358 /// <p>Magnetic: <code>standard</code></p></li>
359 /// </ul><important>
360 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
361 /// </important>
362 /// <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>
363 /// <p>Default: <code>gp2</code></p>
364 pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
365 self.inner = self.inner.volume_type(input);
366 self
367 }
368 /// <p>The volume type. This parameter can be one of the following values:</p>
369 /// <ul>
370 /// <li>
371 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
372 /// <li>
373 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
374 /// <li>
375 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
376 /// <li>
377 /// <p>Cold HDD: <code>sc1</code></p></li>
378 /// <li>
379 /// <p>Magnetic: <code>standard</code></p></li>
380 /// </ul><important>
381 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
382 /// </important>
383 /// <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>
384 /// <p>Default: <code>gp2</code></p>
385 pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
386 self.inner = self.inner.set_volume_type(input);
387 self
388 }
389 /// <p>The volume type. This parameter can be one of the following values:</p>
390 /// <ul>
391 /// <li>
392 /// <p>General Purpose SSD: <code>gp2</code> | <code>gp3</code></p></li>
393 /// <li>
394 /// <p>Provisioned IOPS SSD: <code>io1</code> | <code>io2</code></p></li>
395 /// <li>
396 /// <p>Throughput Optimized HDD: <code>st1</code></p></li>
397 /// <li>
398 /// <p>Cold HDD: <code>sc1</code></p></li>
399 /// <li>
400 /// <p>Magnetic: <code>standard</code></p></li>
401 /// </ul><important>
402 /// <p>Throughput Optimized HDD (<code>st1</code>) and Cold HDD (<code>sc1</code>) volumes can't be used as boot volumes.</p>
403 /// </important>
404 /// <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>
405 /// <p>Default: <code>gp2</code></p>
406 pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
407 self.inner.get_volume_type()
408 }
409 ///
410 /// Appends an item to `TagSpecifications`.
411 ///
412 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
413 ///
414 /// <p>The tags to apply to the volume during creation.</p>
415 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
416 self.inner = self.inner.tag_specifications(input);
417 self
418 }
419 /// <p>The tags to apply to the volume during creation.</p>
420 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
421 self.inner = self.inner.set_tag_specifications(input);
422 self
423 }
424 /// <p>The tags to apply to the volume during creation.</p>
425 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
426 self.inner.get_tag_specifications()
427 }
428 /// <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>
429 pub fn multi_attach_enabled(mut self, input: bool) -> Self {
430 self.inner = self.inner.multi_attach_enabled(input);
431 self
432 }
433 /// <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>
434 pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
435 self.inner = self.inner.set_multi_attach_enabled(input);
436 self
437 }
438 /// <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>
439 pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
440 self.inner.get_multi_attach_enabled()
441 }
442 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
443 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
444 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
445 pub fn throughput(mut self, input: i32) -> Self {
446 self.inner = self.inner.throughput(input);
447 self
448 }
449 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
450 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
451 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
452 pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
453 self.inner = self.inner.set_throughput(input);
454 self
455 }
456 /// <p>The throughput to provision for a volume, with a maximum of 1,000 MiB/s.</p>
457 /// <p>This parameter is valid only for <code>gp3</code> volumes.</p>
458 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
459 pub fn get_throughput(&self) -> &::std::option::Option<i32> {
460 self.inner.get_throughput()
461 }
462 /// <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>
463 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
464 self.inner = self.inner.client_token(input.into());
465 self
466 }
467 /// <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>
468 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
469 self.inner = self.inner.set_client_token(input);
470 self
471 }
472 /// <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>
473 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
474 self.inner.get_client_token()
475 }
476 /// <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>
477 /// <p>This parameter is supported only for volumes created from snapshots. Omit this parameter if:</p>
478 /// <ul>
479 /// <li>
480 /// <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>
481 /// <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>
482 /// </note></li>
483 /// <li>
484 /// <p>You want to create a volume that is initialized at the default rate.</p></li>
485 /// </ul>
486 /// <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>
487 /// <p>Valid range: 100 - 300 MiB/s</p>
488 pub fn volume_initialization_rate(mut self, input: i32) -> Self {
489 self.inner = self.inner.volume_initialization_rate(input);
490 self
491 }
492 /// <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>
493 /// <p>This parameter is supported only for volumes created from snapshots. Omit this parameter if:</p>
494 /// <ul>
495 /// <li>
496 /// <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>
497 /// <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>
498 /// </note></li>
499 /// <li>
500 /// <p>You want to create a volume that is initialized at the default rate.</p></li>
501 /// </ul>
502 /// <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>
503 /// <p>Valid range: 100 - 300 MiB/s</p>
504 pub fn set_volume_initialization_rate(mut self, input: ::std::option::Option<i32>) -> Self {
505 self.inner = self.inner.set_volume_initialization_rate(input);
506 self
507 }
508 /// <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>
509 /// <p>This parameter is supported only for volumes created from snapshots. Omit this parameter if:</p>
510 /// <ul>
511 /// <li>
512 /// <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>
513 /// <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>
514 /// </note></li>
515 /// <li>
516 /// <p>You want to create a volume that is initialized at the default rate.</p></li>
517 /// </ul>
518 /// <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>
519 /// <p>Valid range: 100 - 300 MiB/s</p>
520 pub fn get_volume_initialization_rate(&self) -> &::std::option::Option<i32> {
521 self.inner.get_volume_initialization_rate()
522 }
523 /// <p>Reserved for internal use.</p>
524 pub fn operator(mut self, input: crate::types::OperatorRequest) -> Self {
525 self.inner = self.inner.operator(input);
526 self
527 }
528 /// <p>Reserved for internal use.</p>
529 pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorRequest>) -> Self {
530 self.inner = self.inner.set_operator(input);
531 self
532 }
533 /// <p>Reserved for internal use.</p>
534 pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorRequest> {
535 self.inner.get_operator()
536 }
537 /// <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>
538 pub fn dry_run(mut self, input: bool) -> Self {
539 self.inner = self.inner.dry_run(input);
540 self
541 }
542 /// <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>
543 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
544 self.inner = self.inner.set_dry_run(input);
545 self
546 }
547 /// <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>
548 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
549 self.inner.get_dry_run()
550 }
551}