Skip to main content

access_key_last_useds

Creates, updates, deletes, gets or lists an access_key_last_useds resource.

Overview

Nameaccess_key_last_useds
TypeResource
Idaws.iam.access_key_last_useds

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
last_used_datestringThe date and time, in ISO 8601 date-time format, when the access key was most recently used. This field is null in the following situations: The user does not have an access key. An access key exists but has not been used since IAM began tracking this information. There is no sign-in data associated with the user.
regionstringThe Amazon Web Services Region where this access key was most recently used. The value for this field is "N/A" in the following situations: The user does not have an access key. An access key exists but has not been used since IAM began tracking this information. There is no sign-in data associated with the user. For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon Web Services General Reference.
service_namestringThe name of the Amazon Web Services service with which this access key was most recently used. The value of this field is "N/A" in the following situations: The user does not have an access key. An access key exists but has not been used since IAM started tracking this information. There is no sign-in data associated with the user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_access_key_last_usedselectAccessKeyId, regionRetrieves information about when the specified access key was last used. The information includes the date and time of last use, along with the Amazon Web Services service and Region that were specified in the last request made with that key.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
AccessKeyIdstringThe identifier of an access key. This parameter allows (through its regex pattern) a string of characters that can consist of any upper or lowercased letter or digit.
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves information about when the specified access key was last used. The information includes the date and time of last use, along with the Amazon Web Services service and Region that were specified in the last request made with that key.

SELECT
last_used_date,
region,
service_name
FROM aws.iam.access_key_last_useds
WHERE AccessKeyId = '{{ AccessKeyId }}' -- required
AND region = '{{ region }}' -- required
;