aws_sdk_kms/client/enable_key_rotation.rs
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`EnableKeyRotation`](crate::operation::enable_key_rotation::builders::EnableKeyRotationFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`key_id(impl Into<String>)`](crate::operation::enable_key_rotation::builders::EnableKeyRotationFluentBuilder::key_id) / [`set_key_id(Option<String>)`](crate::operation::enable_key_rotation::builders::EnableKeyRotationFluentBuilder::set_key_id):<br>required: **true**<br><p>Identifies a symmetric encryption KMS key. You cannot enable automatic rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">asymmetric KMS keys</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html">HMAC KMS keys</a>, KMS keys with <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">imported key material</a>, or KMS keys in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>. To enable or disable automatic rotation of a set of related <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate">multi-Region keys</a>, set the property on the primary key.</p> <p>Specify the key ID or key ARN of the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li> <li> <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li> </ul> <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p><br>
/// - [`rotation_period_in_days(i32)`](crate::operation::enable_key_rotation::builders::EnableKeyRotationFluentBuilder::rotation_period_in_days) / [`set_rotation_period_in_days(Option<i32>)`](crate::operation::enable_key_rotation::builders::EnableKeyRotationFluentBuilder::set_rotation_period_in_days):<br>required: **false**<br><p>Use this parameter to specify a custom period of time between each rotation date. If no value is specified, the default value is 365 days.</p> <p>The rotation period defines the number of days after you enable automatic key rotation that KMS will rotate your key material, and the number of days between each automatic rotation thereafter.</p> <p>You can use the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-rotation-period-in-days"> <code>kms:RotationPeriodInDays</code> </a> condition key to further constrain the values that principals can specify in the <code>RotationPeriodInDays</code> parameter.</p> <p></p><br>
/// - On success, responds with [`EnableKeyRotationOutput`](crate::operation::enable_key_rotation::EnableKeyRotationOutput)
/// - On failure, responds with [`SdkError<EnableKeyRotationError>`](crate::operation::enable_key_rotation::EnableKeyRotationError)
pub fn enable_key_rotation(&self) -> crate::operation::enable_key_rotation::builders::EnableKeyRotationFluentBuilder {
crate::operation::enable_key_rotation::builders::EnableKeyRotationFluentBuilder::new(self.handle.clone())
}
}