In this section, weโre going to practice using IAM Roles by creating one ourselves.
๐ Step 1: Navigate to Roles
Start in the IAM dashboard, then click Roles in the left sidebar.
You'll likely see a few roles already listed โ could be two, could be more, depending on what's been set up.
๐ก Thatโs completely normal โ AWS may create some by default
โ Step 2: Start Creating a New Role
Now, weโre going to create our own role.
๐ Reminder: A role is a way to give AWS entities permissions to perform actions
Click on Create role

๐งฉ Step 3: Choose Role Type
Youโll now see different types of roles you can create.

There are multiple options available
But for this hands-on (and for the exam), we focus on: โ AWS Service

โ๏ธ Step 4: Select the Service (EC2)
Next, pick the service that'll use this role. You'll see common ones listed โ EC2, Lambda, and several others.

For this example: select EC2, use case EC2. Ignore the rest for now.
Click Next

๐ Step 5: Attach Permissions (Policy)
Now that weโre creating a role for EC2: ๐ We need to assign permissions
Attach the policy: IAMReadOnlyAccess

๐ก This allows the EC2 instance to:
Read information from IAM
But not modify anything

Click Next
๐ท๏ธ Step 6: Name the Role
Now, give your role a name.
๐ Example: DemoRoleForEC2

๐ค Step 7: Review Trusted Entity

You'll now see trusted entities โ this defines who's allowed to actually assume the role.
In this case, it's trusted by EC2. That's what makes this an EC2 role specifically โ not just any role, one EC2 is permitted to use.
โ Step 8: Review & Create
Before creating the role:
Verify the permissions: IAMReadOnlyAccess is attached
๐ Then click: Create role

๐ Step 9: Role Created
Your role is now created.

It will appear in your roles list
You can click on it to verify: Permissions and Configuration
๐ง When Will We Use This Role?
At this stage:
We have created the role
But we wonโt use it just yet
๐ We will use it later in the EC2 section