access_key_last_useds
Creates, updates, deletes, gets or lists an access_key_last_useds resource.
Overview
| Name | access_key_last_useds |
| Type | Resource |
| Id | aws.iam.access_key_last_useds |
Fields
The following fields are returned by SELECT queries:
- get_access_key_last_used
| Name | Datatype | Description |
|---|---|---|
last_used_date | string | The 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. |
region | string | The 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_name | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_access_key_last_used | select | AccessKeyId, region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
AccessKeyId | string | The 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. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_access_key_last_used
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
;