Home > Back-end >  How can I check if a IAM access key is active via the AWS JS SDK
How can I check if a IAM access key is active via the AWS JS SDK

Time:06-30

When using the AWS Management Console its easy to check whether a IAM access key is active or not.

How can I check if a IAM access key is active via the AWS JS SDK?

CodePudding user response:

The API call ListAccessKeys will return information about all of a user's access keys, including creation date (which answers your other question). There's also GetAccessKeyLastUsed, which as its name indicates tells you when a key was last used.

I don't use the JS SDK, so these functions might not exist there, but look under the IAM module.

CodePudding user response:

There is no way to retrieve that, you can check if the key is available but not if active or not

API_GetAccessKeyInfo

This operation does not indicate the state of the access key. The key might be active, inactive, or deleted. Active keys might not have permissions to perform an operation. Providing a deleted access key might return an error that the key doesn't exist.

  • Related