Create an access key for an IAM user
This topic describes how to use Amazon Command Line Interface (Amazon CLI) commands to create a set of access keys for an Amazon Identity and Access Management (IAM) user. For more information on the IAM service, see the Amazon Identity and Access Management User Guide.
Before you run any commands, set your default credentials. For more information, see Configuring the Amazon CLI.
You can use the
create-access-key
A user can create only two access keys at one time. If you try to create a third set, the
command returns a LimitExceeded
error.
$
aws iam create-access-key --user-name
MyUser
{ "AccessKey": { "UserName": "
MyUser
", "AccessKeyId": "AKIAIOSFODNN7EXAMPLE", "Status": "Active", "SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "CreateDate": "2018-12-14T17:34:16Z" } }
Use the
delete-access-key
$
aws iam delete-access-key --user-name
MyUser
--access-key-id AKIAIOSFODNN7EXAMPLE