aws iam create-access-key
Creates a new Amazon Web Services secret access key and corresponding Amazon Web Services access key ID for the specified user. AWS CLI reference
1 example 1 option Its page in the AWS CLI reference
Examples
To create an access key for an IAM user
The following create-access-key example creates an access key (access key ID and secret access key) for the IAM user named Bob.
aws iam create-access-key --user-name BobIdentify--user-nameThe name of the IAM user that the new key will belong to.Its output
{
"AccessKey": {
"UserName": "Bob",
"Status": "Active",
"CreateDate": "2015-03-09T18:39:23.411Z",
"SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
"AccessKeyId": "AKIAIOSFODNN7EXAMPLE"
}
}Store the secret access key in a secure location. If it is lost, it cannot be recovered, and you must create a new access key.
For more information, see Managing access keys for IAM users in the AWS IAM User Guide.
Options
--user-nameThe name of the IAM user that the new key will belong to.