aws iam update-access-key
Changes the status of the specified access key from Active to Inactive, or vice versa. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To activate or deactivate an access key for an IAM user
The following update-access-key example deactivates the specified access key (access key ID and secret access key) for the IAM user named Bob.
aws iam update-access-key --access-key-id AKIAIOSFODNN7EXAMPLE --status Inactive --user-name BobIdentify--access-key-idThe access key ID of the secret access key you want to update.--statusThe status you want to assign to the secret access key.--user-nameThe name of the user whose key you want to update.This command produces no output.
Deactivating the key means that it cannot be used for programmatic access to AWS. However, the key is still available and can be reactivated.
For more information, see Managing access keys for IAM users in the AWS IAM User Guide.
Options
--access-key-idThe access key ID of the secret access key you want to update.--statusThe status you want to assign to the secret access key.--user-nameThe name of the user whose key you want to update.