aws_sdk_cloudwatchlogs/client/associate_kms_key.rs
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`AssociateKmsKey`](crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`log_group_name(impl Into<String>)`](crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder::log_group_name) / [`set_log_group_name(Option<String>)`](crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder::set_log_group_name):<br>required: **false**<br><p>The name of the log group.</p> <p>In your <code>AssociateKmsKey</code> operation, you must specify either the <code>resourceIdentifier</code> parameter or the <code>logGroup</code> parameter, but you can't specify both.</p><br>
/// - [`kms_key_id(impl Into<String>)`](crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder::kms_key_id) / [`set_kms_key_id(Option<String>)`](crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder::set_kms_key_id):<br>required: **true**<br><p>The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. This must be a symmetric KMS key. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms">Amazon Resource Names</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric Keys</a>.</p><br>
/// - [`resource_identifier(impl Into<String>)`](crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder::resource_identifier) / [`set_resource_identifier(Option<String>)`](crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder::set_resource_identifier):<br>required: **false**<br><p>Specifies the target for this operation. You must specify one of the following:</p> <ul> <li> <p>Specify the following ARN to have future <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html">GetQueryResults</a> operations in this account encrypt the results with the specified KMS key. Replace <i>REGION</i> and <i>ACCOUNT_ID</i> with your Region and account ID.</p> <p><code>arn:aws:logs:<i>REGION</i>:<i>ACCOUNT_ID</i>:query-result:*</code></p></li> <li> <p>Specify the ARN of a log group to have CloudWatch Logs use the KMS key to encrypt log events that are ingested and stored by that log group. The log group ARN must be in the following format. Replace <i>REGION</i> and <i>ACCOUNT_ID</i> with your Region and account ID.</p> <p><code>arn:aws:logs:<i>REGION</i>:<i>ACCOUNT_ID</i>:log-group:<i>LOG_GROUP_NAME</i> </code></p></li> </ul> <p>In your <code>AssociateKmsKey</code> operation, you must specify either the <code>resourceIdentifier</code> parameter or the <code>logGroup</code> parameter, but you can't specify both.</p><br>
/// - On success, responds with [`AssociateKmsKeyOutput`](crate::operation::associate_kms_key::AssociateKmsKeyOutput)
/// - On failure, responds with [`SdkError<AssociateKmsKeyError>`](crate::operation::associate_kms_key::AssociateKmsKeyError)
pub fn associate_kms_key(&self) -> crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder {
crate::operation::associate_kms_key::builders::AssociateKmsKeyFluentBuilder::new(self.handle.clone())
}
}