GetAccessKeyLastUsed - AWS Identity and Access Management
AWS services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with AWS services in China.


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

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.


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.

Type: String

Length Constraints: Minimum length of 16. Maximum length of 128.

Pattern: [\w]+

Required: Yes

Response Elements

The following elements are returned by the service.


Contains information about the last time the access key was used.

Type: AccessKeyLastUsed object


The name of the AWS IAM user that owns this access key.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [\w+=,.@-]+


For information about the errors that are common to all actions, see Common Errors.


The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

HTTP Status Code: 404



This example illustrates one usage of GetAccessKeyLastUsed.

Sample Request ?Action=GetAccessKeyLastUsed &AccessKeyId=AKIAIOSFODNN7EXAMPLE &Version=2010-05-08 &AUTHPARAMS

Sample Response

<GetAccessKeyLastUsedResponse xmlns=""> <GetAccessKeyLastUsedResult> <AccessKeyLastUsed> <Region>us-west-2</Region> <LastUsedDate>2015-03-13T10:45:00Z</LastUsedDate> <ServiceName>s3</ServiceName> </AccessKeyLastUsed> <UserName>bob</UserName> </GetAccessKeyLastUsedResult> <ResponseMetadata> <RequestId>510a6abf-d022-11e4-abe8-9b0ebEXAMPLE</RequestId> </ResponseMetadata> </GetAccessKeyLastUsedResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: