To create a user in AWS IAM using the CLI (after you have configured it), use the following:
Create a user with programmatic access (access key ID and secret access key):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
$ aws iam create-user \ --user-name User_Prog_Access Response: { "User": { "Path": "/", "UserName": "User_Prog_Access", "UserId": "AIDExampleUserId", "Arn": "arn:aws:iam::123333333:user/User_Prog_Access", "CreateDate": "2021-01-29T12:20:43+00:00" } } $ aws iam create-access-key \ --user-name User_Prog_Access Response: { "AccessKey": { "UserName": "User_Prog_Access", "AccessKeyId": "AKIExampleAccessKeyID", "Status": "Active", "SecretAccessKey": "ttExampleSecretAccessKey", "CreateDate": "2021-01-29T12:21:22+00:00" } } |
And for a user with console access:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
$ aws iam create-user \ --user-name User_Console_Access Response: { "User": { "Path": "/", "UserName": "User_Console_Access", "UserId": "AIExampleUserId", "Arn": "arn:aws:iam::933323111111:user/User_Console_Access", "CreateDate": "2021-01-29T12:31:46+00:00" } } $ aws iam create-login-profile \ --user-name User_Console_Access \ --password Temp_Password4 \ --password-reset-required Response: { "LoginProfile": { "UserName": "User_Console_Access", "CreateDate": "2021-01-29T12:35:28+00:00", "PasswordResetRequired": true } } |