DEV Community

Cover image for Day 20.Create IAM Role for EC2 with Policy Attachment
Thu Kha Kyawe
Thu Kha Kyawe

Posted on

Day 20.Create IAM Role for EC2 with Policy Attachment

Lab Information

When establishing infrastructure on the AWS cloud, Identity and Access Management (IAM) is among the first and most critical services to configure. IAM facilitates the creation and management of user accounts, groups, roles, policies, and other access controls. The Nautilus DevOps team is currently in the process of configuring these resources and has outlined the following requirements:

Create an IAM role as below:

1) IAM role name must be iamrole_mark.

2) Entity type must be AWS Service and use case must be EC2.

3) Attach a policy named iampolicy_mark.

Lab Solutions

Step-by-Step Instructions (AWS Console)

  1. Log in to AWS Console

Use your lab credentials.

  1. Open IAM Service

In the AWS search bar → type IAM

Click IAM

  1. Create the IAM Role

In the left navigation pane → click Roles

Click Create role

  1. Select Trusted Entity

On the Select trusted entity page:

Trusted entity type: AWS service

Use case: EC2

Click Next.

  1. Attach Permissions Policy

In the permissions list, search for:

iampolicy_mark

Select the policy iampolicy_mark

Click Next

  1. Name the Role

On the Name, review, and create page:

Role name: iamrole_mark

(Optional) Description:

IAM role for EC2 with iampolicy_mark attached

Click Create role.


Resources & Next Steps
📦 Full Code Repository: KodeKloud Learning Labs
📖 More Deep Dives: Whispering Cloud Insights - Read other technical articles
💬 Join Discussion: DEV Community - Share your thoughts and questions
💼 Let's Connect: LinkedIn - I'd love to connect with you

Credits
• All labs are from: KodeKloud
• I sincerely appreciate your provision of these valuable resources.

Top comments (0)