aws_sdk_kms/operation/update_alias/_update_alias_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 UpdateAliasInput {
6 /// <p>Identifies the alias that is changing its KMS key. This value must begin with <code>alias/</code> followed by the alias name, such as <code>alias/ExampleAlias</code>. You cannot use <code>UpdateAlias</code> to change the alias name.</p><important>
7 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
8 /// </important>
9 pub alias_name: ::std::option::Option<::std::string::String>,
10 /// <p>Identifies the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer managed key</a> to associate with the alias. You don't have permission to associate an alias with an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
11 /// <p>The KMS key must be in the same Amazon Web Services account and Region as the alias. Also, the new target KMS key must be the same type as the current target KMS key (both symmetric or both asymmetric or both HMAC) and they must have the same key usage.</p>
12 /// <p>Specify the key ID or key ARN of the KMS key.</p>
13 /// <p>For example:</p>
14 /// <ul>
15 /// <li>
16 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
17 /// <li>
18 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
19 /// </ul>
20 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
21 /// <p>To verify that the alias is mapped to the correct KMS key, use <code>ListAliases</code>.</p>
22 pub target_key_id: ::std::option::Option<::std::string::String>,
23}
24impl UpdateAliasInput {
25 /// <p>Identifies the alias that is changing its KMS key. This value must begin with <code>alias/</code> followed by the alias name, such as <code>alias/ExampleAlias</code>. You cannot use <code>UpdateAlias</code> to change the alias name.</p><important>
26 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
27 /// </important>
28 pub fn alias_name(&self) -> ::std::option::Option<&str> {
29 self.alias_name.as_deref()
30 }
31 /// <p>Identifies the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer managed key</a> to associate with the alias. You don't have permission to associate an alias with an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
32 /// <p>The KMS key must be in the same Amazon Web Services account and Region as the alias. Also, the new target KMS key must be the same type as the current target KMS key (both symmetric or both asymmetric or both HMAC) and they must have the same key usage.</p>
33 /// <p>Specify the key ID or key ARN of the KMS key.</p>
34 /// <p>For example:</p>
35 /// <ul>
36 /// <li>
37 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
38 /// <li>
39 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
40 /// </ul>
41 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
42 /// <p>To verify that the alias is mapped to the correct KMS key, use <code>ListAliases</code>.</p>
43 pub fn target_key_id(&self) -> ::std::option::Option<&str> {
44 self.target_key_id.as_deref()
45 }
46}
47impl UpdateAliasInput {
48 /// Creates a new builder-style object to manufacture [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
49 pub fn builder() -> crate::operation::update_alias::builders::UpdateAliasInputBuilder {
50 crate::operation::update_alias::builders::UpdateAliasInputBuilder::default()
51 }
52}
53
54/// A builder for [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct UpdateAliasInputBuilder {
58 pub(crate) alias_name: ::std::option::Option<::std::string::String>,
59 pub(crate) target_key_id: ::std::option::Option<::std::string::String>,
60}
61impl UpdateAliasInputBuilder {
62 /// <p>Identifies the alias that is changing its KMS key. This value must begin with <code>alias/</code> followed by the alias name, such as <code>alias/ExampleAlias</code>. You cannot use <code>UpdateAlias</code> to change the alias name.</p><important>
63 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
64 /// </important>
65 /// This field is required.
66 pub fn alias_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.alias_name = ::std::option::Option::Some(input.into());
68 self
69 }
70 /// <p>Identifies the alias that is changing its KMS key. This value must begin with <code>alias/</code> followed by the alias name, such as <code>alias/ExampleAlias</code>. You cannot use <code>UpdateAlias</code> to change the alias name.</p><important>
71 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
72 /// </important>
73 pub fn set_alias_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.alias_name = input;
75 self
76 }
77 /// <p>Identifies the alias that is changing its KMS key. This value must begin with <code>alias/</code> followed by the alias name, such as <code>alias/ExampleAlias</code>. You cannot use <code>UpdateAlias</code> to change the alias name.</p><important>
78 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
79 /// </important>
80 pub fn get_alias_name(&self) -> &::std::option::Option<::std::string::String> {
81 &self.alias_name
82 }
83 /// <p>Identifies the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer managed key</a> to associate with the alias. You don't have permission to associate an alias with an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
84 /// <p>The KMS key must be in the same Amazon Web Services account and Region as the alias. Also, the new target KMS key must be the same type as the current target KMS key (both symmetric or both asymmetric or both HMAC) and they must have the same key usage.</p>
85 /// <p>Specify the key ID or key ARN of the KMS key.</p>
86 /// <p>For example:</p>
87 /// <ul>
88 /// <li>
89 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
90 /// <li>
91 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
92 /// </ul>
93 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
94 /// <p>To verify that the alias is mapped to the correct KMS key, use <code>ListAliases</code>.</p>
95 /// This field is required.
96 pub fn target_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.target_key_id = ::std::option::Option::Some(input.into());
98 self
99 }
100 /// <p>Identifies the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer managed key</a> to associate with the alias. You don't have permission to associate an alias with an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
101 /// <p>The KMS key must be in the same Amazon Web Services account and Region as the alias. Also, the new target KMS key must be the same type as the current target KMS key (both symmetric or both asymmetric or both HMAC) and they must have the same key usage.</p>
102 /// <p>Specify the key ID or key ARN of the KMS key.</p>
103 /// <p>For example:</p>
104 /// <ul>
105 /// <li>
106 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
107 /// <li>
108 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
109 /// </ul>
110 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
111 /// <p>To verify that the alias is mapped to the correct KMS key, use <code>ListAliases</code>.</p>
112 pub fn set_target_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.target_key_id = input;
114 self
115 }
116 /// <p>Identifies the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer managed key</a> to associate with the alias. You don't have permission to associate an alias with an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
117 /// <p>The KMS key must be in the same Amazon Web Services account and Region as the alias. Also, the new target KMS key must be the same type as the current target KMS key (both symmetric or both asymmetric or both HMAC) and they must have the same key usage.</p>
118 /// <p>Specify the key ID or key ARN of the KMS key.</p>
119 /// <p>For example:</p>
120 /// <ul>
121 /// <li>
122 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
123 /// <li>
124 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
125 /// </ul>
126 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
127 /// <p>To verify that the alias is mapped to the correct KMS key, use <code>ListAliases</code>.</p>
128 pub fn get_target_key_id(&self) -> &::std::option::Option<::std::string::String> {
129 &self.target_key_id
130 }
131 /// Consumes the builder and constructs a [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
132 pub fn build(self) -> ::std::result::Result<crate::operation::update_alias::UpdateAliasInput, ::aws_smithy_types::error::operation::BuildError> {
133 ::std::result::Result::Ok(crate::operation::update_alias::UpdateAliasInput {
134 alias_name: self.alias_name,
135 target_key_id: self.target_key_id,
136 })
137 }
138}