Skip to main content

aws_sdk_ec2/operation/modify_ebs_default_kms_key_id/
_modify_ebs_default_kms_key_id_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ModifyEbsDefaultKmsKeyIdInput {
6    /// <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>
7    /// <p>You can specify the KMS key using any of the following:</p>
8    /// <ul>
9    /// <li>
10    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
11    /// <li>
12    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
13    /// <li>
14    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
15    /// <li>
16    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
17    /// </ul>
18    /// <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>
19    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
20    pub kms_key_id: ::std::option::Option<::std::string::String>,
21    /// <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>
22    pub dry_run: ::std::option::Option<bool>,
23}
24impl ModifyEbsDefaultKmsKeyIdInput {
25    /// <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>
26    /// <p>You can specify the KMS key using any of the following:</p>
27    /// <ul>
28    /// <li>
29    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
30    /// <li>
31    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
32    /// <li>
33    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
34    /// <li>
35    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
36    /// </ul>
37    /// <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>
38    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
39    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
40        self.kms_key_id.as_deref()
41    }
42    /// <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>
43    pub fn dry_run(&self) -> ::std::option::Option<bool> {
44        self.dry_run
45    }
46}
47impl ModifyEbsDefaultKmsKeyIdInput {
48    /// Creates a new builder-style object to manufacture [`ModifyEbsDefaultKmsKeyIdInput`](crate::operation::modify_ebs_default_kms_key_id::ModifyEbsDefaultKmsKeyIdInput).
49    pub fn builder() -> crate::operation::modify_ebs_default_kms_key_id::builders::ModifyEbsDefaultKmsKeyIdInputBuilder {
50        crate::operation::modify_ebs_default_kms_key_id::builders::ModifyEbsDefaultKmsKeyIdInputBuilder::default()
51    }
52}
53
54/// A builder for [`ModifyEbsDefaultKmsKeyIdInput`](crate::operation::modify_ebs_default_kms_key_id::ModifyEbsDefaultKmsKeyIdInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct ModifyEbsDefaultKmsKeyIdInputBuilder {
58    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
59    pub(crate) dry_run: ::std::option::Option<bool>,
60}
61impl ModifyEbsDefaultKmsKeyIdInputBuilder {
62    /// <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>
63    /// <p>You can specify the KMS key using any of the following:</p>
64    /// <ul>
65    /// <li>
66    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
67    /// <li>
68    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
69    /// <li>
70    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
71    /// <li>
72    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
73    /// </ul>
74    /// <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>
75    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
76    /// This field is required.
77    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.kms_key_id = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <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>
82    /// <p>You can specify the KMS key using any of the following:</p>
83    /// <ul>
84    /// <li>
85    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
86    /// <li>
87    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
88    /// <li>
89    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
90    /// <li>
91    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
92    /// </ul>
93    /// <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>
94    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
95    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.kms_key_id = input;
97        self
98    }
99    /// <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>
100    /// <p>You can specify the KMS key using any of the following:</p>
101    /// <ul>
102    /// <li>
103    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
104    /// <li>
105    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
106    /// <li>
107    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
108    /// <li>
109    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
110    /// </ul>
111    /// <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>
112    /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
113    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
114        &self.kms_key_id
115    }
116    /// <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>
117    pub fn dry_run(mut self, input: bool) -> Self {
118        self.dry_run = ::std::option::Option::Some(input);
119        self
120    }
121    /// <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>
122    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
123        self.dry_run = input;
124        self
125    }
126    /// <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>
127    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
128        &self.dry_run
129    }
130    /// Consumes the builder and constructs a [`ModifyEbsDefaultKmsKeyIdInput`](crate::operation::modify_ebs_default_kms_key_id::ModifyEbsDefaultKmsKeyIdInput).
131    pub fn build(
132        self,
133    ) -> ::std::result::Result<
134        crate::operation::modify_ebs_default_kms_key_id::ModifyEbsDefaultKmsKeyIdInput,
135        ::aws_smithy_types::error::operation::BuildError,
136    > {
137        ::std::result::Result::Ok(crate::operation::modify_ebs_default_kms_key_id::ModifyEbsDefaultKmsKeyIdInput {
138            kms_key_id: self.kms_key_id,
139            dry_run: self.dry_run,
140        })
141    }
142}