Create IAM User and Group#
Create an admin-level IAM user for day-to-day account management. _This will be primary AWS login management user .#
- Navigate to the IAM dashboard. You can also use the search bar at the top of the console to find it.
- Click on “Users” under “Access Management” in the menu on the left, then click “Create user.”
- Give the IAM user a name like
alperen-admin(using your own name). - Check the box “Provide user access to the AWS Management Console.”
- Have AWS auto-generate an initial password, and leave the box checked to require a password reset on first login.
- Create a new group for this user, called
Administrators. Attach theAdministratorAccesspolicy to the group. Only the one policy is needed. - Assign the IAM user that you’re creating to the new group.
- On the “Review and create” step, if everything looks right, click “Create user.”
- Download the credentials CSV file. Note that AWS gives you a sign-in URL, the IAM username, and the initial password. The sign-in URL has your AWS account ID in it.
In the web console, log out of your root user, then log in as the new IAM admin user.#
- Use the sign-in URL from the credentials CSV.
- The account ID should be pre-populated on the sign-in page, but save the ID number in case you need it for any future logins.
- Enter the username you created and the auto-generated initial password.
- You’ll be prompted to set a new password for the IAM user. Create one and save it.
- If prompted, set up MFA for the IAM user as well (not as critical as with the root user, but still recommended).
From this point on, use the IAM admin user unless a root user login is absolutely necessary. We’ll be learning a lot more about IAM and scoped security throughout this document.
Go back to your terminal and authenticate the AWS CLI using the IAM admin user.#
- Make sure you’re using AWS CLI
2.32.0or newer. - Run
aws loginand follow the browser auth flow. - If
aws loginis denied, your IAM user or group may be missing the permissions required for local development sign-in.
Verify your logged-in status. Run:
aws sts get-caller-identityThe output should include your UserId, Account number, and Arn.
The Arn should include iam and end with the IAM username you created.