Module Values.GetKeyLastUsageResponseSource

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 KeyLastUsage response element is present, the key has been used for a successful cryptographic operation since the TrackingStartDate. The response includes the operation type, timestamp, and associated CloudTrail event ID. If the KeyLastUsage response element is empty and KeyCreationDate is on or after TrackingStartDate, the key has not been used for a successful cryptographic operation since it was created. If the KeyLastUsage response element is empty and KeyCreationDate is before TrackingStartDate, there is no record of the key being used for a successful cryptographic operation since the TrackingStartDate. However, the key may have been used before tracking began. To determine whether the key was used before the TrackingStartDate, 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.

Sourcetype nonrec t = {
  1. keyId : KeyIdType.t option;
    (*

    The globally unique identifier for the KMS key.

    *)
  2. keyLastUsage : KeyLastUsageData.t option;
    (*

    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.

    *)
  3. trackingStartDate : DateType.t option;
    (*

    The date from which KMS began recording cryptographic activity for this key, or the date the KMS key was created, whichever is later.

    *)
  4. keyCreationDate : DateType.t option;
    (*

    The date and time when the KMS key was created.

    *)
}
Sourcetype nonrec error = [
  1. | `DependencyTimeoutException of DependencyTimeoutException.t
  2. | `InvalidArnException of InvalidArnException.t
  3. | `KMSInternalException of KMSInternalException.t
  4. | `NotFoundException of NotFoundException.t
  5. | `Unknown_operation_error of string * string option
]
Sourceval make : ?keyId:??? -> ?keyLastUsage:??? -> ?trackingStartDate:??? -> ?keyCreationDate:??? -> unit -> t
Sourceval error_of_json : string -> Yojson.Safe.t -> [> `DependencyTimeoutException of DependencyTimeoutException.t | `InvalidArnException of InvalidArnException.t | `KMSInternalException of KMSInternalException.t | `NotFoundException of NotFoundException.t | `Unknown_operation_error of string * string option ]
Sourceval error_of_xml : string -> Awso.Xml.t -> [> `DependencyTimeoutException of DependencyTimeoutException.t | `InvalidArnException of InvalidArnException.t | `KMSInternalException of KMSInternalException.t | `NotFoundException of NotFoundException.t | `Unknown_operation_error of string * string option ]
Sourceval error_to_json : error -> Yojson.Safe.t
Sourceval to_value : t -> [> `Structure of (string * [> `String of KeyIdType.t | `Structure of (string * [> `Enum of string | `String of CloudTrailEventIdType.t | `Timestamp of DateType.t ]) list | `Timestamp of DateType.t ]) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t