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 in the destination Region.</p>
10 pub description: ::std::option::Option<::std::string::String>,
11 /// <p>Specifies whether the destination snapshots of the copied image should be encrypted. 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>
12 pub encrypted: ::std::option::Option<bool>,
13 /// <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>
14 /// <p>You can specify a KMS key using any of the following:</p>
15 /// <ul>
16 /// <li>
17 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
18 /// <li>
19 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
20 /// <li>
21 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
22 /// <li>
23 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
24 /// </ul>
25 /// <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>
26 /// <p>The specified KMS key must exist in the destination Region.</p>
27 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
28 pub kms_key_id: ::std::option::Option<::std::string::String>,
29 /// <p>The name of the new AMI in the destination Region.</p>
30 pub name: ::std::option::Option<::std::string::String>,
31 /// <p>The ID of the AMI to copy.</p>
32 pub source_image_id: ::std::option::Option<::std::string::String>,
33 /// <p>The name of the Region that contains the AMI to copy.</p>
34 pub source_region: ::std::option::Option<::std::string::String>,
35 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. 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 cannot copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
36 /// <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>
37 pub destination_outpost_arn: ::std::option::Option<::std::string::String>,
38 /// <p>Indicates whether to include your user-defined AMI tags when copying the AMI.</p>
39 /// <p>The following tags will not be copied:</p>
40 /// <ul>
41 /// <li>
42 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
43 /// <li>
44 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
45 /// </ul>
46 /// <p>Default: Your user-defined AMI tags are not copied.</p>
47 pub copy_image_tags: ::std::option::Option<bool>,
48 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
49 /// <ul>
50 /// <li>
51 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
52 /// <li>
53 /// <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>
54 /// </ul>
55 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
56 /// <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>
57 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
58 /// <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>
59 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p>
60 /// <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>
61 pub snapshot_copy_completion_duration_minutes: ::std::option::Option<i64>,
62 /// <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>
63 pub dry_run: ::std::option::Option<bool>,
64}
65impl CopyImageInput {
66 /// <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>
67 pub fn client_token(&self) -> ::std::option::Option<&str> {
68 self.client_token.as_deref()
69 }
70 /// <p>A description for the new AMI in the destination Region.</p>
71 pub fn description(&self) -> ::std::option::Option<&str> {
72 self.description.as_deref()
73 }
74 /// <p>Specifies whether the destination snapshots of the copied image should be encrypted. 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>
75 pub fn encrypted(&self) -> ::std::option::Option<bool> {
76 self.encrypted
77 }
78 /// <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>
79 /// <p>You can specify a KMS key using any of the following:</p>
80 /// <ul>
81 /// <li>
82 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
83 /// <li>
84 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
85 /// <li>
86 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
87 /// <li>
88 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
89 /// </ul>
90 /// <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>
91 /// <p>The specified KMS key must exist in the destination Region.</p>
92 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
93 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
94 self.kms_key_id.as_deref()
95 }
96 /// <p>The name of the new AMI in the destination Region.</p>
97 pub fn name(&self) -> ::std::option::Option<&str> {
98 self.name.as_deref()
99 }
100 /// <p>The ID of the AMI to copy.</p>
101 pub fn source_image_id(&self) -> ::std::option::Option<&str> {
102 self.source_image_id.as_deref()
103 }
104 /// <p>The name of the Region that contains the AMI to copy.</p>
105 pub fn source_region(&self) -> ::std::option::Option<&str> {
106 self.source_region.as_deref()
107 }
108 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. 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 cannot copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
109 /// <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>
110 pub fn destination_outpost_arn(&self) -> ::std::option::Option<&str> {
111 self.destination_outpost_arn.as_deref()
112 }
113 /// <p>Indicates whether to include your user-defined AMI tags when copying the AMI.</p>
114 /// <p>The following tags will not be copied:</p>
115 /// <ul>
116 /// <li>
117 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
118 /// <li>
119 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
120 /// </ul>
121 /// <p>Default: Your user-defined AMI tags are not copied.</p>
122 pub fn copy_image_tags(&self) -> ::std::option::Option<bool> {
123 self.copy_image_tags
124 }
125 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
126 /// <ul>
127 /// <li>
128 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
129 /// <li>
130 /// <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>
131 /// </ul>
132 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
133 /// <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>
134 ///
135 /// 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()`.
136 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
137 self.tag_specifications.as_deref().unwrap_or_default()
138 }
139 /// <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>
140 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p>
141 /// <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>
142 pub fn snapshot_copy_completion_duration_minutes(&self) -> ::std::option::Option<i64> {
143 self.snapshot_copy_completion_duration_minutes
144 }
145 /// <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>
146 pub fn dry_run(&self) -> ::std::option::Option<bool> {
147 self.dry_run
148 }
149}
150impl CopyImageInput {
151 /// Creates a new builder-style object to manufacture [`CopyImageInput`](crate::operation::copy_image::CopyImageInput).
152 pub fn builder() -> crate::operation::copy_image::builders::CopyImageInputBuilder {
153 crate::operation::copy_image::builders::CopyImageInputBuilder::default()
154 }
155}
156
157/// A builder for [`CopyImageInput`](crate::operation::copy_image::CopyImageInput).
158#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
159#[non_exhaustive]
160pub struct CopyImageInputBuilder {
161 pub(crate) client_token: ::std::option::Option<::std::string::String>,
162 pub(crate) description: ::std::option::Option<::std::string::String>,
163 pub(crate) encrypted: ::std::option::Option<bool>,
164 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
165 pub(crate) name: ::std::option::Option<::std::string::String>,
166 pub(crate) source_image_id: ::std::option::Option<::std::string::String>,
167 pub(crate) source_region: ::std::option::Option<::std::string::String>,
168 pub(crate) destination_outpost_arn: ::std::option::Option<::std::string::String>,
169 pub(crate) copy_image_tags: ::std::option::Option<bool>,
170 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
171 pub(crate) snapshot_copy_completion_duration_minutes: ::std::option::Option<i64>,
172 pub(crate) dry_run: ::std::option::Option<bool>,
173}
174impl CopyImageInputBuilder {
175 /// <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>
176 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177 self.client_token = ::std::option::Option::Some(input.into());
178 self
179 }
180 /// <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>
181 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182 self.client_token = input;
183 self
184 }
185 /// <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>
186 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
187 &self.client_token
188 }
189 /// <p>A description for the new AMI in the destination Region.</p>
190 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.description = ::std::option::Option::Some(input.into());
192 self
193 }
194 /// <p>A description for the new AMI in the destination Region.</p>
195 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.description = input;
197 self
198 }
199 /// <p>A description for the new AMI in the destination Region.</p>
200 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
201 &self.description
202 }
203 /// <p>Specifies whether the destination snapshots of the copied image should be encrypted. 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>
204 pub fn encrypted(mut self, input: bool) -> Self {
205 self.encrypted = ::std::option::Option::Some(input);
206 self
207 }
208 /// <p>Specifies whether the destination snapshots of the copied image should be encrypted. 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>
209 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
210 self.encrypted = input;
211 self
212 }
213 /// <p>Specifies whether the destination snapshots of the copied image should be encrypted. 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>
214 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
215 &self.encrypted
216 }
217 /// <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>
218 /// <p>You can specify a KMS key using any of the following:</p>
219 /// <ul>
220 /// <li>
221 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
222 /// <li>
223 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
224 /// <li>
225 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
226 /// <li>
227 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
228 /// </ul>
229 /// <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>
230 /// <p>The specified KMS key must exist in the destination Region.</p>
231 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
232 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
233 self.kms_key_id = ::std::option::Option::Some(input.into());
234 self
235 }
236 /// <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>
237 /// <p>You can specify a KMS key using any of the following:</p>
238 /// <ul>
239 /// <li>
240 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
241 /// <li>
242 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
243 /// <li>
244 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
245 /// <li>
246 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
247 /// </ul>
248 /// <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>
249 /// <p>The specified KMS key must exist in the destination Region.</p>
250 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
251 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252 self.kms_key_id = input;
253 self
254 }
255 /// <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>
256 /// <p>You can specify a KMS key using any of the following:</p>
257 /// <ul>
258 /// <li>
259 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
260 /// <li>
261 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
262 /// <li>
263 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
264 /// <li>
265 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
266 /// </ul>
267 /// <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>
268 /// <p>The specified KMS key must exist in the destination Region.</p>
269 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
270 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
271 &self.kms_key_id
272 }
273 /// <p>The name of the new AMI in the destination Region.</p>
274 /// This field is required.
275 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
276 self.name = ::std::option::Option::Some(input.into());
277 self
278 }
279 /// <p>The name of the new AMI in the destination Region.</p>
280 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
281 self.name = input;
282 self
283 }
284 /// <p>The name of the new AMI in the destination Region.</p>
285 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
286 &self.name
287 }
288 /// <p>The ID of the AMI to copy.</p>
289 /// This field is required.
290 pub fn source_image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
291 self.source_image_id = ::std::option::Option::Some(input.into());
292 self
293 }
294 /// <p>The ID of the AMI to copy.</p>
295 pub fn set_source_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
296 self.source_image_id = input;
297 self
298 }
299 /// <p>The ID of the AMI to copy.</p>
300 pub fn get_source_image_id(&self) -> &::std::option::Option<::std::string::String> {
301 &self.source_image_id
302 }
303 /// <p>The name of the Region that contains the AMI to copy.</p>
304 /// This field is required.
305 pub fn source_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
306 self.source_region = ::std::option::Option::Some(input.into());
307 self
308 }
309 /// <p>The name of the Region that contains the AMI to copy.</p>
310 pub fn set_source_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
311 self.source_region = input;
312 self
313 }
314 /// <p>The name of the Region that contains the AMI to copy.</p>
315 pub fn get_source_region(&self) -> &::std::option::Option<::std::string::String> {
316 &self.source_region
317 }
318 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. 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 cannot copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
319 /// <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>
320 pub fn destination_outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
321 self.destination_outpost_arn = ::std::option::Option::Some(input.into());
322 self
323 }
324 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. 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 cannot copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
325 /// <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>
326 pub fn set_destination_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
327 self.destination_outpost_arn = input;
328 self
329 }
330 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. 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 cannot copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
331 /// <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>
332 pub fn get_destination_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
333 &self.destination_outpost_arn
334 }
335 /// <p>Indicates whether to include your user-defined AMI tags when copying the AMI.</p>
336 /// <p>The following tags will not be copied:</p>
337 /// <ul>
338 /// <li>
339 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
340 /// <li>
341 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
342 /// </ul>
343 /// <p>Default: Your user-defined AMI tags are not copied.</p>
344 pub fn copy_image_tags(mut self, input: bool) -> Self {
345 self.copy_image_tags = ::std::option::Option::Some(input);
346 self
347 }
348 /// <p>Indicates whether to include your user-defined AMI tags when copying the AMI.</p>
349 /// <p>The following tags will not be copied:</p>
350 /// <ul>
351 /// <li>
352 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
353 /// <li>
354 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
355 /// </ul>
356 /// <p>Default: Your user-defined AMI tags are not copied.</p>
357 pub fn set_copy_image_tags(mut self, input: ::std::option::Option<bool>) -> Self {
358 self.copy_image_tags = input;
359 self
360 }
361 /// <p>Indicates whether to include your user-defined AMI tags when copying the AMI.</p>
362 /// <p>The following tags will not be copied:</p>
363 /// <ul>
364 /// <li>
365 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
366 /// <li>
367 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
368 /// </ul>
369 /// <p>Default: Your user-defined AMI tags are not copied.</p>
370 pub fn get_copy_image_tags(&self) -> &::std::option::Option<bool> {
371 &self.copy_image_tags
372 }
373 /// Appends an item to `tag_specifications`.
374 ///
375 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
376 ///
377 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
378 /// <ul>
379 /// <li>
380 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
381 /// <li>
382 /// <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>
383 /// </ul>
384 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
385 /// <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>
386 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
387 let mut v = self.tag_specifications.unwrap_or_default();
388 v.push(input);
389 self.tag_specifications = ::std::option::Option::Some(v);
390 self
391 }
392 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
393 /// <ul>
394 /// <li>
395 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
396 /// <li>
397 /// <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>
398 /// </ul>
399 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
400 /// <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>
401 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
402 self.tag_specifications = input;
403 self
404 }
405 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
406 /// <ul>
407 /// <li>
408 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
409 /// <li>
410 /// <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>
411 /// </ul>
412 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
413 /// <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>
414 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
415 &self.tag_specifications
416 }
417 /// <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>
418 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p>
419 /// <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>
420 pub fn snapshot_copy_completion_duration_minutes(mut self, input: i64) -> Self {
421 self.snapshot_copy_completion_duration_minutes = ::std::option::Option::Some(input);
422 self
423 }
424 /// <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>
425 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p>
426 /// <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>
427 pub fn set_snapshot_copy_completion_duration_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
428 self.snapshot_copy_completion_duration_minutes = input;
429 self
430 }
431 /// <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>
432 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p>
433 /// <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>
434 pub fn get_snapshot_copy_completion_duration_minutes(&self) -> &::std::option::Option<i64> {
435 &self.snapshot_copy_completion_duration_minutes
436 }
437 /// <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>
438 pub fn dry_run(mut self, input: bool) -> Self {
439 self.dry_run = ::std::option::Option::Some(input);
440 self
441 }
442 /// <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>
443 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
444 self.dry_run = input;
445 self
446 }
447 /// <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>
448 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
449 &self.dry_run
450 }
451 /// Consumes the builder and constructs a [`CopyImageInput`](crate::operation::copy_image::CopyImageInput).
452 pub fn build(self) -> ::std::result::Result<crate::operation::copy_image::CopyImageInput, ::aws_smithy_types::error::operation::BuildError> {
453 ::std::result::Result::Ok(crate::operation::copy_image::CopyImageInput {
454 client_token: self.client_token,
455 description: self.description,
456 encrypted: self.encrypted,
457 kms_key_id: self.kms_key_id,
458 name: self.name,
459 source_image_id: self.source_image_id,
460 source_region: self.source_region,
461 destination_outpost_arn: self.destination_outpost_arn,
462 copy_image_tags: self.copy_image_tags,
463 tag_specifications: self.tag_specifications,
464 snapshot_copy_completion_duration_minutes: self.snapshot_copy_completion_duration_minutes,
465 dry_run: self.dry_run,
466 })
467 }
468}