DEV Community

Cover image for How to setup and configure an IAM user in AWS
Ukeme David Eseme
Ukeme David Eseme

Posted on

How to setup and configure an IAM user in AWS

AWS Identity and Access Management (IAM) is an AWS service, designed for access control across all of AWS.
you use IAM policies, to manage permissions and to ensure least-privilege permissions, throughout your workforce and systems.

Now, lets create an IAM User.

IAM User Setup

Step 1

Create an AWS root account, on the AWS console

Step 2

Login to your AWS console, on the top left corner, click on Services > Security, Identity & Compliance then click on IAM

Aws Security, Identity & Compliance

IAM

Step 3

Click on User on the left navigation bar, then on the User dashboard click on Add User

User dashboard

Step 4

Enter your username and for Select AWS credential type, select Access key - Programmatic access
click on Next

AWS IAM User setup

Step 5

Set permissions, on this page, click on Attach existing policies directly.

Aws Attach Policies
You can attach any policy depending on your workload, but for this exercise choose AmazonS3FullAccess.
This policy gives this user full access to Amazon Simple Storage Service (S3)

Next Tags, Next Review

Click on Create User

Step 6

This step is very Important.
Your user Access key ID and Secret access key are displayed on this final page. You also have the option to download your credentials in csv format.

Keep your credentials safe, as you would be needing it to configure AWS CLI on your local environment.

Note: do not reveal your AWS credentials to anyone, as they would have access to your user and all its resources.
Keep your credential private

_You have successfully created an IAM User using the AWS console.
_

Now lets increase the pace, for this next session we would be configuring our IAM User using the AWS CLI.

Lets dive in!

dive in

Configure IAM User using AWS CLI

You would need to install Git for this section

What is AWS CLI?

It stands for Amazon Web Service Command Line Interface a unified tool to manage your AWS services.
The CLI is used to download, configure and control multiple AWS services.

Follow this Article to install AWS CLI

After installation, we can begin with configuration.

Step 1

Open your terminal, then use this command

aws configure
Enter fullscreen mode Exit fullscreen mode

Input your IAM User credentials, Access key ID, Secret access key, Region (use us-east-1 for this example), for default output format, input JSON

AWS configure

Step 2

run

cat ~/.aws/credentials
Enter fullscreen mode Exit fullscreen mode

on your terminal, compare the credentials displayed to what is on the _csv _file you downloaded earlier. If they match move to the next step.

Aws credentials

Step 3

run

aws sts get-caller-identity
Enter fullscreen mode Exit fullscreen mode

You should get an output similar to this.

caller identity

Step 4

run

aws iam list-users
Enter fullscreen mode Exit fullscreen mode

You should get an output similar to this.

Iam list-users

You have successfully configured an IAM user locally, using AWS CLI

If you run into any errors while setting up any of the above mentioned installation or errors while following any of the steps, feel free to message me directly. I am here to help.

If this post has in anyway added value to you, show some support, like, share, subscribe.

Discussion (0)