pub struct GetKeyLastUsageFluentBuilder { /* private fields */ }Expand description
Fluent builder constructing a request to GetKeyLastUsage.
Returns usage information about the last successful cryptographic operation performed with a specified KMS key, including the operation type, timestamp, and associated CloudTrail event ID.
The TrackingStartDate in the GetKeyLastUsage response indicates the date from which KMS began recording cryptographic activity for a given key. Use this value together with KeyCreationDate to understand the key's usage history:
-
If the
KeyLastUsageresponse element is present, the key has been used for a successful cryptographic operation since theTrackingStartDate. The response includes the operation type, timestamp, and associated CloudTrail event ID. -
If the
KeyLastUsageresponse element is empty andKeyCreationDateis on or afterTrackingStartDate, the key has not been used for a successful cryptographic operation since it was created. -
If the
KeyLastUsageresponse element is empty andKeyCreationDateis beforeTrackingStartDate, there is no record of the key being used for a successful cryptographic operation since theTrackingStartDate. However, the key may have been used before tracking began. To determine whether the key was used before theTrackingStartDate, examine your past CloudTrail logs.
For multi-Region KMS keys, primary and replica keys track last usage independently. Each key in a multi-Region key set maintains its own usage information.
The ReEncrypt operation uses two keys: a source key for decryption and a destination key for encryption. Usage information is recorded for both keys independently, each with the CloudTrail event ID from the respective key owner's account.
Do not use GetKeyLastUsage as the sole indicator when scheduling a key for deletion. Instead, first disable the key and monitor CloudTrail for DisabledException entries, as there could be infrequent workflows that are dependent on the key. By looking for this exception, you can identify potential dependencies and workload failures before they occur.
Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.
Required permissions: kms:GetKeyLastUsage (key policy)
Related operations:
-
DescribeKey -
DisableKey -
ScheduleKeyDeletion
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
Implementations§
Source§impl GetKeyLastUsageFluentBuilder
impl GetKeyLastUsageFluentBuilder
Sourcepub fn as_input(&self) -> &GetKeyLastUsageInputBuilder
pub fn as_input(&self) -> &GetKeyLastUsageInputBuilder
Access the GetKeyLastUsage as a reference.
Sourcepub async fn send(
self,
) -> Result<GetKeyLastUsageOutput, SdkError<GetKeyLastUsageError, HttpResponse>>
pub async fn send( self, ) -> Result<GetKeyLastUsageOutput, SdkError<GetKeyLastUsageError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
Sourcepub fn customize(
self,
) -> CustomizableOperation<GetKeyLastUsageOutput, GetKeyLastUsageError, Self>
pub fn customize( self, ) -> CustomizableOperation<GetKeyLastUsageOutput, GetKeyLastUsageError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn key_id(self, input: impl Into<String>) -> Self
pub fn key_id(self, input: impl Into<String>) -> Self
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.
Specify the key ID or key ARN of the KMS key.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
Sourcepub fn set_key_id(self, input: Option<String>) -> Self
pub fn set_key_id(self, input: Option<String>) -> Self
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.
Specify the key ID or key ARN of the KMS key.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
Sourcepub fn get_key_id(&self) -> &Option<String>
pub fn get_key_id(&self) -> &Option<String>
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.
Specify the key ID or key ARN of the KMS key.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
Trait Implementations§
Source§impl Clone for GetKeyLastUsageFluentBuilder
impl Clone for GetKeyLastUsageFluentBuilder
Source§fn clone(&self) -> GetKeyLastUsageFluentBuilder
fn clone(&self) -> GetKeyLastUsageFluentBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for GetKeyLastUsageFluentBuilder
impl !UnwindSafe for GetKeyLastUsageFluentBuilder
impl Freeze for GetKeyLastUsageFluentBuilder
impl Send for GetKeyLastUsageFluentBuilder
impl Sync for GetKeyLastUsageFluentBuilder
impl Unpin for GetKeyLastUsageFluentBuilder
impl UnsafeUnpin for GetKeyLastUsageFluentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more