aws_sdk_ec2/operation/copy_image/
_copy_image_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the parameters for CopyImage.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CopyImageInput {
7    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
8    pub client_token: ::std::option::Option<::std::string::String>,
9    /// <p>A description for the new AMI.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
12    /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
13    pub encrypted: ::std::option::Option<bool>,
14    /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
15    /// <p>You can specify a KMS key using any of the following:</p>
16    /// <ul>
17    /// <li>
18    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
19    /// <li>
20    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
21    /// <li>
22    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
23    /// <li>
24    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
25    /// </ul>
26    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
27    /// <p>The specified KMS key must exist in the destination Region.</p>
28    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
29    pub kms_key_id: ::std::option::Option<::std::string::String>,
30    /// <p>The name of the new AMI.</p>
31    pub name: ::std::option::Option<::std::string::String>,
32    /// <p>The ID of the AMI to copy.</p>
33    pub source_image_id: ::std::option::Option<::std::string::String>,
34    /// <p>The name of the Region that contains the AMI to copy.</p>
35    pub source_region: ::std::option::Option<::std::string::String>,
36    /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
37    /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
38    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
39    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
40    pub destination_outpost_arn: ::std::option::Option<::std::string::String>,
41    /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
42    /// <p>The following tags are not be copied:</p>
43    /// <ul>
44    /// <li>
45    /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
46    /// <li>
47    /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
48    /// </ul>
49    /// <p>Default: Your user-defined AMI tags are not copied.</p>
50    pub copy_image_tags: ::std::option::Option<bool>,
51    /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
52    /// <ul>
53    /// <li>
54    /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
55    /// <li>
56    /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
57    /// </ul>
58    /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
59    /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
60    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
61    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
62    /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
63    /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
64    /// </note>
65    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
66    pub snapshot_copy_completion_duration_minutes: ::std::option::Option<i64>,
67    /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
68    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
69    pub destination_availability_zone: ::std::option::Option<::std::string::String>,
70    /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
71    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
72    pub destination_availability_zone_id: ::std::option::Option<::std::string::String>,
73    /// <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>
74    pub dry_run: ::std::option::Option<bool>,
75}
76impl CopyImageInput {
77    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
78    pub fn client_token(&self) -> ::std::option::Option<&str> {
79        self.client_token.as_deref()
80    }
81    /// <p>A description for the new AMI.</p>
82    pub fn description(&self) -> ::std::option::Option<&str> {
83        self.description.as_deref()
84    }
85    /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
86    /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
87    pub fn encrypted(&self) -> ::std::option::Option<bool> {
88        self.encrypted
89    }
90    /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
91    /// <p>You can specify a KMS key using any of the following:</p>
92    /// <ul>
93    /// <li>
94    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
95    /// <li>
96    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
97    /// <li>
98    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
99    /// <li>
100    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
101    /// </ul>
102    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
103    /// <p>The specified KMS key must exist in the destination Region.</p>
104    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
105    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
106        self.kms_key_id.as_deref()
107    }
108    /// <p>The name of the new AMI.</p>
109    pub fn name(&self) -> ::std::option::Option<&str> {
110        self.name.as_deref()
111    }
112    /// <p>The ID of the AMI to copy.</p>
113    pub fn source_image_id(&self) -> ::std::option::Option<&str> {
114        self.source_image_id.as_deref()
115    }
116    /// <p>The name of the Region that contains the AMI to copy.</p>
117    pub fn source_region(&self) -> ::std::option::Option<&str> {
118        self.source_region.as_deref()
119    }
120    /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
121    /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
122    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
123    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
124    pub fn destination_outpost_arn(&self) -> ::std::option::Option<&str> {
125        self.destination_outpost_arn.as_deref()
126    }
127    /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
128    /// <p>The following tags are not be copied:</p>
129    /// <ul>
130    /// <li>
131    /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
132    /// <li>
133    /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
134    /// </ul>
135    /// <p>Default: Your user-defined AMI tags are not copied.</p>
136    pub fn copy_image_tags(&self) -> ::std::option::Option<bool> {
137        self.copy_image_tags
138    }
139    /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
140    /// <ul>
141    /// <li>
142    /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
143    /// <li>
144    /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
145    /// </ul>
146    /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
147    /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
148    ///
149    /// 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()`.
150    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
151        self.tag_specifications.as_deref().unwrap_or_default()
152    }
153    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
154    /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
155    /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
156    /// </note>
157    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
158    pub fn snapshot_copy_completion_duration_minutes(&self) -> ::std::option::Option<i64> {
159        self.snapshot_copy_completion_duration_minutes
160    }
161    /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
162    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
163    pub fn destination_availability_zone(&self) -> ::std::option::Option<&str> {
164        self.destination_availability_zone.as_deref()
165    }
166    /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
167    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
168    pub fn destination_availability_zone_id(&self) -> ::std::option::Option<&str> {
169        self.destination_availability_zone_id.as_deref()
170    }
171    /// <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>
172    pub fn dry_run(&self) -> ::std::option::Option<bool> {
173        self.dry_run
174    }
175}
176impl CopyImageInput {
177    /// Creates a new builder-style object to manufacture [`CopyImageInput`](crate::operation::copy_image::CopyImageInput).
178    pub fn builder() -> crate::operation::copy_image::builders::CopyImageInputBuilder {
179        crate::operation::copy_image::builders::CopyImageInputBuilder::default()
180    }
181}
182
183/// A builder for [`CopyImageInput`](crate::operation::copy_image::CopyImageInput).
184#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
185#[non_exhaustive]
186pub struct CopyImageInputBuilder {
187    pub(crate) client_token: ::std::option::Option<::std::string::String>,
188    pub(crate) description: ::std::option::Option<::std::string::String>,
189    pub(crate) encrypted: ::std::option::Option<bool>,
190    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
191    pub(crate) name: ::std::option::Option<::std::string::String>,
192    pub(crate) source_image_id: ::std::option::Option<::std::string::String>,
193    pub(crate) source_region: ::std::option::Option<::std::string::String>,
194    pub(crate) destination_outpost_arn: ::std::option::Option<::std::string::String>,
195    pub(crate) copy_image_tags: ::std::option::Option<bool>,
196    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
197    pub(crate) snapshot_copy_completion_duration_minutes: ::std::option::Option<i64>,
198    pub(crate) destination_availability_zone: ::std::option::Option<::std::string::String>,
199    pub(crate) destination_availability_zone_id: ::std::option::Option<::std::string::String>,
200    pub(crate) dry_run: ::std::option::Option<bool>,
201}
202impl CopyImageInputBuilder {
203    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
204    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.client_token = ::std::option::Option::Some(input.into());
206        self
207    }
208    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
209    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.client_token = input;
211        self
212    }
213    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
214    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
215        &self.client_token
216    }
217    /// <p>A description for the new AMI.</p>
218    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219        self.description = ::std::option::Option::Some(input.into());
220        self
221    }
222    /// <p>A description for the new AMI.</p>
223    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224        self.description = input;
225        self
226    }
227    /// <p>A description for the new AMI.</p>
228    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
229        &self.description
230    }
231    /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
232    /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
233    pub fn encrypted(mut self, input: bool) -> Self {
234        self.encrypted = ::std::option::Option::Some(input);
235        self
236    }
237    /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
238    /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
239    pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
240        self.encrypted = input;
241        self
242    }
243    /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
244    /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
245    pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
246        &self.encrypted
247    }
248    /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
249    /// <p>You can specify a KMS key using any of the following:</p>
250    /// <ul>
251    /// <li>
252    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
253    /// <li>
254    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
255    /// <li>
256    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
257    /// <li>
258    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
259    /// </ul>
260    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
261    /// <p>The specified KMS key must exist in the destination Region.</p>
262    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
263    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264        self.kms_key_id = ::std::option::Option::Some(input.into());
265        self
266    }
267    /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
268    /// <p>You can specify a KMS key using any of the following:</p>
269    /// <ul>
270    /// <li>
271    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
272    /// <li>
273    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
274    /// <li>
275    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
276    /// <li>
277    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
278    /// </ul>
279    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
280    /// <p>The specified KMS key must exist in the destination Region.</p>
281    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
282    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.kms_key_id = input;
284        self
285    }
286    /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
287    /// <p>You can specify a KMS key using any of the following:</p>
288    /// <ul>
289    /// <li>
290    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
291    /// <li>
292    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
293    /// <li>
294    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
295    /// <li>
296    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
297    /// </ul>
298    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
299    /// <p>The specified KMS key must exist in the destination Region.</p>
300    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
301    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
302        &self.kms_key_id
303    }
304    /// <p>The name of the new AMI.</p>
305    /// This field is required.
306    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
307        self.name = ::std::option::Option::Some(input.into());
308        self
309    }
310    /// <p>The name of the new AMI.</p>
311    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
312        self.name = input;
313        self
314    }
315    /// <p>The name of the new AMI.</p>
316    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
317        &self.name
318    }
319    /// <p>The ID of the AMI to copy.</p>
320    /// This field is required.
321    pub fn source_image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
322        self.source_image_id = ::std::option::Option::Some(input.into());
323        self
324    }
325    /// <p>The ID of the AMI to copy.</p>
326    pub fn set_source_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
327        self.source_image_id = input;
328        self
329    }
330    /// <p>The ID of the AMI to copy.</p>
331    pub fn get_source_image_id(&self) -> &::std::option::Option<::std::string::String> {
332        &self.source_image_id
333    }
334    /// <p>The name of the Region that contains the AMI to copy.</p>
335    /// This field is required.
336    pub fn source_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
337        self.source_region = ::std::option::Option::Some(input.into());
338        self
339    }
340    /// <p>The name of the Region that contains the AMI to copy.</p>
341    pub fn set_source_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
342        self.source_region = input;
343        self
344    }
345    /// <p>The name of the Region that contains the AMI to copy.</p>
346    pub fn get_source_region(&self) -> &::std::option::Option<::std::string::String> {
347        &self.source_region
348    }
349    /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
350    /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
351    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
352    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
353    pub fn destination_outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
354        self.destination_outpost_arn = ::std::option::Option::Some(input.into());
355        self
356    }
357    /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
358    /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
359    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
360    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
361    pub fn set_destination_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
362        self.destination_outpost_arn = input;
363        self
364    }
365    /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
366    /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
367    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
368    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
369    pub fn get_destination_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
370        &self.destination_outpost_arn
371    }
372    /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
373    /// <p>The following tags are not be copied:</p>
374    /// <ul>
375    /// <li>
376    /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
377    /// <li>
378    /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
379    /// </ul>
380    /// <p>Default: Your user-defined AMI tags are not copied.</p>
381    pub fn copy_image_tags(mut self, input: bool) -> Self {
382        self.copy_image_tags = ::std::option::Option::Some(input);
383        self
384    }
385    /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
386    /// <p>The following tags are not be copied:</p>
387    /// <ul>
388    /// <li>
389    /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
390    /// <li>
391    /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
392    /// </ul>
393    /// <p>Default: Your user-defined AMI tags are not copied.</p>
394    pub fn set_copy_image_tags(mut self, input: ::std::option::Option<bool>) -> Self {
395        self.copy_image_tags = input;
396        self
397    }
398    /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
399    /// <p>The following tags are not be copied:</p>
400    /// <ul>
401    /// <li>
402    /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
403    /// <li>
404    /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
405    /// </ul>
406    /// <p>Default: Your user-defined AMI tags are not copied.</p>
407    pub fn get_copy_image_tags(&self) -> &::std::option::Option<bool> {
408        &self.copy_image_tags
409    }
410    /// Appends an item to `tag_specifications`.
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 new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
415    /// <ul>
416    /// <li>
417    /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
418    /// <li>
419    /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
420    /// </ul>
421    /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
422    /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
423    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
424        let mut v = self.tag_specifications.unwrap_or_default();
425        v.push(input);
426        self.tag_specifications = ::std::option::Option::Some(v);
427        self
428    }
429    /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
430    /// <ul>
431    /// <li>
432    /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
433    /// <li>
434    /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
435    /// </ul>
436    /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
437    /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
438    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
439        self.tag_specifications = input;
440        self
441    }
442    /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
443    /// <ul>
444    /// <li>
445    /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
446    /// <li>
447    /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
448    /// </ul>
449    /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
450    /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
451    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
452        &self.tag_specifications
453    }
454    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
455    /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
456    /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
457    /// </note>
458    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
459    pub fn snapshot_copy_completion_duration_minutes(mut self, input: i64) -> Self {
460        self.snapshot_copy_completion_duration_minutes = ::std::option::Option::Some(input);
461        self
462    }
463    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
464    /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
465    /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
466    /// </note>
467    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
468    pub fn set_snapshot_copy_completion_duration_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
469        self.snapshot_copy_completion_duration_minutes = input;
470        self
471    }
472    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
473    /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
474    /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
475    /// </note>
476    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
477    pub fn get_snapshot_copy_completion_duration_minutes(&self) -> &::std::option::Option<i64> {
478        &self.snapshot_copy_completion_duration_minutes
479    }
480    /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
481    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
482    pub fn destination_availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
483        self.destination_availability_zone = ::std::option::Option::Some(input.into());
484        self
485    }
486    /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
487    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
488    pub fn set_destination_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
489        self.destination_availability_zone = input;
490        self
491    }
492    /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
493    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
494    pub fn get_destination_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
495        &self.destination_availability_zone
496    }
497    /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
498    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
499    pub fn destination_availability_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
500        self.destination_availability_zone_id = ::std::option::Option::Some(input.into());
501        self
502    }
503    /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
504    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
505    pub fn set_destination_availability_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
506        self.destination_availability_zone_id = input;
507        self
508    }
509    /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
510    /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
511    pub fn get_destination_availability_zone_id(&self) -> &::std::option::Option<::std::string::String> {
512        &self.destination_availability_zone_id
513    }
514    /// <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>
515    pub fn dry_run(mut self, input: bool) -> Self {
516        self.dry_run = ::std::option::Option::Some(input);
517        self
518    }
519    /// <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>
520    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
521        self.dry_run = input;
522        self
523    }
524    /// <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>
525    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
526        &self.dry_run
527    }
528    /// Consumes the builder and constructs a [`CopyImageInput`](crate::operation::copy_image::CopyImageInput).
529    pub fn build(self) -> ::std::result::Result<crate::operation::copy_image::CopyImageInput, ::aws_smithy_types::error::operation::BuildError> {
530        ::std::result::Result::Ok(crate::operation::copy_image::CopyImageInput {
531            client_token: self.client_token,
532            description: self.description,
533            encrypted: self.encrypted,
534            kms_key_id: self.kms_key_id,
535            name: self.name,
536            source_image_id: self.source_image_id,
537            source_region: self.source_region,
538            destination_outpost_arn: self.destination_outpost_arn,
539            copy_image_tags: self.copy_image_tags,
540            tag_specifications: self.tag_specifications,
541            snapshot_copy_completion_duration_minutes: self.snapshot_copy_completion_duration_minutes,
542            destination_availability_zone: self.destination_availability_zone,
543            destination_availability_zone_id: self.destination_availability_zone_id,
544            dry_run: self.dry_run,
545        })
546    }
547}