Skip to content

Instantly share code, notes, and snippets.

@altairlage
Created June 17, 2019 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save altairlage/8bc0f4cfc82cb12273af8a34b40b540d to your computer and use it in GitHub Desktop.
Save altairlage/8bc0f4cfc82cb12273af8a34b40b540d to your computer and use it in GitHub Desktop.
How to create and AWS IAM user via CLI
- Create user
aws iam create-user --user-name <username>
- Create login profile (to allow AWS Console access)
aws iam create-login-profile --user-name <value> --password <value> --password-reset-required
- Create access key (for programatic access)
aws iam create-access-key --user-name <username>
- Add user to group
aws iam add-user-to-group --group-name <group name> --user-name <username>
check if user was added:
aws iam get-group --group-name <groupname>
- Attach policy (Optional. Use if you want to set some permissions or attach to a role that isn't in the group)
aws iam attach-user-policy --policy-arn <policy arn> --user-name <username>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment