How to create IAM Roles in AWS

Anurag Bhatt
Analytics Vidhya
Published in
3 min readApr 11, 2021
Photo by Christian Wiediger on Unsplash

Note: I am assuming you already have a working AWS account I will not teach you how to create an AWS account.

Step 1: Inside the search bar type IAM and click on it.

AWS Dashboard

Step 2: Click in Roles under Access management.

IAM Dashboard

Step 3: Click on Create Role

Creating Role

Step 4: Now, we can select any use case. You can select any service I am selecting EC2.

Selecting services means this service which in my case is EC2 will able to access AWS other services like accessing of S3 bucket in simple terms you gave the particular service rights to use other services.

After selecting your service click on Next: Permissions button. After selecting your service the button will be highlighted.

Step 5: Now we will search for the policy which we want to use in my case I want EC2 services to access S3 bucket.

A policy is an object in AWS that, when associated with an entity or resource, defines their permissions. AWS evaluates these policies when a principal, such as a user, makes a request. Permissions in the policies determine whether the request is allowed or denied. Most policies are stored in AWS as JSON documents. — From AWS Article

So, type the policy name which you want I want to access S3 bucket using my EC2 instance so I will type S3 and I will find AmazonS3FullAccess policy select it and click on Next: Tags button.

Attach Policies

You can add as many as policies you want on any particular service to know more about policies click

Step 6: After clicking in Next: Tags button you will be ask to add tags it is optional when you have many policies associated with different users and services it will help to organize policies.

Click on Next:Review button

Step 7: Now, after doing all the above steps write the relevant role name of your policy. So, you will identify what’s this role for .Like in this role I am giving EC2 instances to access S3 bucket. So, i will name my role name according to these two services.

Now, click on Create role button.

You will get the role has been created

Now, how to use this policy?

This article is becoming long. So, I will write in the next article how to use these policies.

If you have any suggestions or you find any errors please comment I will rectify them thanks.

--

--