Creating IAM User with Console and Programmatic Access Lab Guide
Creating IAM User
- Click on “Users” in the left navigation menu and then click on “Add user” button.
- Enter a name for the user in the “User name” field.
- Select the “AWS Management Console access” checkbox to grant console access to the user.
- Create a custom password for the user and check “Require password reset”.
- Click “Next: Permissions”.
- Select the appropriate permissions for the user. You can choose from a range of pre-defined policies (select S3 Admin Access permission from list)
- Click “Next: Tags” and add any tags you want to apply to the user (optional).
- Click “Next: Review”.
- Review the details and click “Create user”.
- Once the user is created, you will see a screen with the user’s details
- Click on the “Security credentials” tab.
- Click on the “Create access key” button to generate an access key and secret access key for the user.
- Download the access key and secret access key or copy them to a secure location
Login with IAM user in IAM Console
- Log in to the AWS Management Console with your root account credentials.
- Navigate to the IAM console by clicking on “Services” in the top navigation bar, selecting “IAM” from the dropdown menu, and then clicking on “Users” in the left navigation pane.
- Select the IAM user whose console sign-in user you want to retrieve by clicking on the user’s name in the list of users.
- On the “Summary” tab, you should see a section labeled “Console access”.
- In the “Console access” section, you will see the IAM user’s console sign-in link. It will be in the following format: https://<aws-account-id>.signin.aws.amazon.com/console/.
- The console sign-in user for the IAM user will be the string that appears after “https://<aws-account-id>.signin.aws.amazon.com/console/” in the sign-in link.
- On the next page, enter the IAM user’s username and password that you created previously and click on the “Sign in” button.
- If multi-factor authentication (MFA) is enabled for the IAM user, you will be prompted to enter the MFA code. Enter the code generated by the MFA device and click on the “Verify MFA” button.
- You will now be logged in to the AWS Management Console with the IAM user’s permissions and access to the resources that are allowed by the user’s policies.
Login with IAM user in AWS CLI
- Install and configure the AWS CLI on your local machine or EC2 instance.
- Open a command prompt or terminal and run the following command to configure the CLI with the IAM user credentials:
aws configure --profile <profile-name>
Replace<profile-name>
with a name for the profile, such as “my-iam-user”. - Enter the access key ID and secret access key when prompted.
- Enter the default region and output format when prompted (optional).
- Run a test command to verify that the credentials are working
aws s3 ls --profile <profile-name>