AWS Identity and Access Management
CLI Reference (API Version 2010-05-08)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

iam-usermodkey

Description

Changes the status of the specified key from active to inactive, or vice versa. This action lets you rotate a user's keys, or immediately disable (or re enable) a user's ability to make API calls to AWS. For information about rotating keys, go to Managing Keys and Certificates in Using AWS Identity and Access Management.

Important

Calling this command without specifying a user name modifies the key for the user who owns the requesting credentials.

Syntax

iam-usermodkey [-u USERNAME] -k ACCESSKEYID -s Active|Inactive

Options

Name Description Required

-u USERNAME

Name of the user whose key you want to update.

Type: String

Default: None

Optional

-k ACCESSKEYID

The Access Key ID of the Secret Access Key you want to update.

Type: String

Default: None

Yes

-s Active|Inactive

The status you want to assign to the Secret Access Key. Active means the user can use the key for API calls to AWS. Inactive means the user cannot use the key for API calls to AWS.

Type: String

Yes

Output

If the key is successfully updated, the output is empty.

Example

The following example changes the status to Inactive for the Secret Access Key with Access Key ID AKIAIOSFODNN7EXAMPLE, which belongs to the user named Bob.

PROMPT> iam-usermodkey -u Bob -k AKIAIOSFODNN7EXAMPLE -s Inactive