aws-sdk-kms 1.106.0

AWS SDK for AWS Key Management Service
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`GetKeyLastUsage`](crate::operation::get_key_last_usage::builders::GetKeyLastUsageFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`key_id(impl Into<String>)`](crate::operation::get_key_last_usage::builders::GetKeyLastUsageFluentBuilder::key_id) / [`set_key_id(Option<String>)`](crate::operation::get_key_last_usage::builders::GetKeyLastUsageFluentBuilder::set_key_id):<br>required: **true**<br><p>Identifies the KMS key to get usage information for. To specify a KMS key, use its key ID or key ARN. Alias names are not supported.</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>
    /// - On success, responds with [`GetKeyLastUsageOutput`](crate::operation::get_key_last_usage::GetKeyLastUsageOutput) with field(s):
    ///   - [`key_id(Option<String>)`](crate::operation::get_key_last_usage::GetKeyLastUsageOutput::key_id): <p>The globally unique identifier for the KMS key.</p>
    ///   - [`key_last_usage(Option<KeyLastUsageData>)`](crate::operation::get_key_last_usage::GetKeyLastUsageOutput::key_last_usage): <p>Contains usage information about the last time the KMS key was used for a successful cryptographic operation. If the key has not been used since tracking began, this response element is empty.</p>
    ///   - [`tracking_start_date(Option<DateTime>)`](crate::operation::get_key_last_usage::GetKeyLastUsageOutput::tracking_start_date): <p>The date from which KMS began recording cryptographic activity for this key, or the date the KMS key was created, whichever is later.</p>
    ///   - [`key_creation_date(Option<DateTime>)`](crate::operation::get_key_last_usage::GetKeyLastUsageOutput::key_creation_date): <p>The date and time when the KMS key was created.</p>
    /// - On failure, responds with [`SdkError<GetKeyLastUsageError>`](crate::operation::get_key_last_usage::GetKeyLastUsageError)
    pub fn get_key_last_usage(&self) -> crate::operation::get_key_last_usage::builders::GetKeyLastUsageFluentBuilder {
        crate::operation::get_key_last_usage::builders::GetKeyLastUsageFluentBuilder::new(self.handle.clone())
    }
}