> ## Documentation Index
> Fetch the complete documentation index at: https://cloud-architect.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating IAM Policies

> Hands-on lab · 30m

Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console.

<a className="ip-lab-portal-btn" href="https://labs.intellectualpoint.com/labs/creating-iam-policies" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

### Lab Details:

1. This lab walks you through the steps to Create IAM policies for different AWS services such as EC2, S3, and DynamoDB.
2. Duration: **30 minutes**
3. AWS Region: **US East (N. Virginia) us-east-1.**

### Introduction:

#### What is AWS IAM Policy ?

* AWS IAM (Identity and Access Management) policy is a security document that defines permissions for users, groups, roles, or AWS resources. It specifies what actions are allowed or denied on specific AWS services and resources, helping control access within an AWS environment.
* IAM policies are written in JSON and outline permissions such as reading, writing, or managing AWS resources like S3 buckets, EC2 instances, or databases. By attaching policies to IAM identities or resources, AWS ensures secure access management and enforces the principle of least privilege.

### Architecture Diagram:

<img src="https://mintcdn.com/ip-cloud-architect-pathway/vScAll09yOH6D8RK/images/labs/creating-iam-policies/001.png?fit=max&auto=format&n=vScAll09yOH6D8RK&q=85&s=2de422184cccfce92fd2779a52098666" alt="" width="1200" height="660" data-path="images/labs/creating-iam-policies/001.png" />

### Task Details:

1. Sign in to AWS Management Console
2. Create an IAM Policy for EC2.
3. Create an IAM Policy for S3.
4. Create an IAM Policy for DynamoDB.
5. Validation of the lab

### Launching the lab environment

1. To launch the lab environment, Click on the **Launch lab** button.
2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
3. Once the Lab is started, you will be provided with **IAM username**, **Password**, **Access** **Key**, and **Secret** **Access** **Key**.

<Note>
  You can only start one lab at any given time
</Note>

## Lab guide

### Lab steps

#### Task 1: Sign in to AWS Management Console

1. Click on the **Open console** button, and you will get redirected to AWS Console in a new browser tab.
2. On the AWS sign-in page,

   * Leave the Account ID as default. Never edit/remove the 12-digit Account ID present in the AWS Console. Otherwise, you cannot proceed with the lab.
   * Now copy your **Username** and **Password** in the Lab Console to the **IAM Username and Password** in AWS Console and click on the **Sign-in** button.
3. Once Signed In to the AWS Management Console, make the default AWS Region as **US East (N. Virginia) us-east-1.**

<Note>
  If you face any issues, please go through [**FAQs and Troubleshooting**](/aws-cp/support/faqs-and-troubleshooting).
</Note>

#### Task 2: Creating an IAM Policy for EC2

In this task, we are going to create an IAM policy specifically for the EC2 (Elastic Compute Cloud) service. EC2 is a core AWS service that provides virtual servers in the cloud. By creating an IAM policy for EC2, users can define the permissions and actions that are allowed or restricted for EC2 resources.

1. Navigate to the **Services** menu at the top, then click on **IAM** in the **Security, identity, & Compliance** section.
2. In the left menu, select **Policies**.
3. Click on **Create Policy** button.
4. Under **Visual**, Type **EC2** in the search box and select **EC2**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/vScAll09yOH6D8RK/images/labs/creating-iam-policies/002.png?fit=max&auto=format&n=vScAll09yOH6D8RK&q=85&s=6897bbeb022d5b24c947b39d8dde02ab" alt="" width="1103" height="382" data-path="images/labs/creating-iam-policies/002.png" />

5. In the **Actions**, specify the actions allowed in EC2. For this service, We'll choose **read.**
6. Click on **Resources,** scroll down and choose **All resources** so that there is no need to specify the resource ARN.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/vScAll09yOH6D8RK/images/labs/creating-iam-policies/003.gif?s=edc50d9e55772562e5c0c460d4ed72bb" alt="" width="1000" height="514" data-path="images/labs/creating-iam-policies/003.gif" />

7. Now scroll up and If you click on the JSON, you can see the policy we created.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/vScAll09yOH6D8RK/images/labs/creating-iam-policies/004.png?fit=max&auto=format&n=vScAll09yOH6D8RK&q=85&s=4553c79114c417d4b6bc6eb7ab4c95d8" alt="" width="460" height="108" data-path="images/labs/creating-iam-policies/004.png" />

8. Click on **Next**
9. Review:

   * Name : Enter **EC2Policy**
   * Description : Enter **EC2 Full Read access**
   * You can see the access level.
   * Review the policy and then click on **Create policy**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/005.png?fit=max&auto=format&n=OagrkbHBQ8SYHp5M&q=85&s=0bdefbf83ac87d5ef55d874967cf51a8" alt="" width="1594" height="1164" data-path="images/labs/creating-iam-policies/005.png" />

10. After creating, you will get a verification for the created Policy.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/006.png?fit=max&auto=format&n=OagrkbHBQ8SYHp5M&q=85&s=8a10d37856c045cd34f90bec1aca1e8d" alt="" width="714" height="72" data-path="images/labs/creating-iam-policies/006.png" />

11. In the fiter policies, type your policy name and click on it.

12. In the Summary, (under the JSON) you can see the policy you created.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/007.png?fit=max&auto=format&n=OagrkbHBQ8SYHp5M&q=85&s=505c120245261f59e89a62b99a338dbf" alt="" width="1782" height="1186" data-path="images/labs/creating-iam-policies/007.png" />

#### Task 3: Creating an IAM Policy for S3

In this task, we are going to create an IAM policy for the S3 (Simple Storage Service) service. S3 is a scalable storage service provided by AWS.

1. Click on **Create Policy** button again.
2. Under **Visual Editor**, type S3 in the search box and select **S3**.
3. In the **Actions**, specify the actions allowed in S3. For this service, we'll choose **List, Tagging** and **Write**.
4. Click on **Resources** and choose **All resources** so that there is no need to specify the resource ARN.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/008.gif?s=9e325d68892876dd1bd92c2f32811380" alt="" width="1000" height="484" data-path="images/labs/creating-iam-policies/008.gif" />

5. If you click on the JSON, you can see the policy we created.
6. Click on **Next** button.
7. Review:

   * Name : Enter **S3Policy**
   * For **Policy description**, type a description for the new policy.
   * In the Summary, you can see the Access level.
   * Review the policy and then click on **Create Policy**.
8. After creating, you will get a verification for the created policy
9. In the filter policies, type your policy name and click on it.
10. In the Summary, (under the JSON) you can see the policy you created.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/009.png?fit=max&auto=format&n=OagrkbHBQ8SYHp5M&q=85&s=a4f56f96ec88a49e12ea18c118780e18" alt="" width="1076" height="497" data-path="images/labs/creating-iam-policies/009.png" />

#### Task 4: Creating an IAM Policy for DynamoDB

In this task, we are going to create an IAM policy for the DynamoDB service. DynamoDB is a fully managed NoSQL database service offered by AWS.

1. Click on **Create Policy** button again.
2. Under **Visual,** type **DynamoDB** in the search box and select **DynamoDB**.
3. In the **Actions**, specify the actions allowed in DynamoDB. For this service, we'll choose **All DynamoDB actions.**
4. Click on **Resources** and choose **All resources** so that there is no need to specify the resource ARN.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/010.gif?s=e8090a02bc9079111839c32a32e8fb56" alt="" width="1000" height="454" data-path="images/labs/creating-iam-policies/010.gif" />

5. If you click on the **JSON** you can see the policy we created.
6. Click on **Next** button.
7. Review:

   * Name : Enter **DynamoDBPolicy**
   * For **Policy description**, type a description for the new policy.
   * In the Summary, you can see the Access level.
   * Review the policy and then click on **Create policy**.
8. After creating, you will get a verification for the created policy
9. In the filter policies, type your policy name and click on it.
10. In the Summary (under the JSON), you can see the policy you created.

?

<img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/011.png?fit=max&auto=format&n=OagrkbHBQ8SYHp5M&q=85&s=c119aec957b8a1a1300811bebca05e6d" alt="" width="1050" height="330" data-path="images/labs/creating-iam-policies/011.png" />

<Tip>
  **Do you know?**

  IAM policies are a powerful tool for managing access to AWS resources, and their default deny rule and support for conditions contribute to the robust security and access control capabilities of the AWS IAM system.
</Tip>

#### Task 5: Validation Test

1. Once the lab steps are completed, please click on the **Check my work** button on the left side panel.
2. This will validate the resources in the AWS account and displays whether you have completed this lab successfully or not.
3. Sample output :

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/OagrkbHBQ8SYHp5M/images/labs/creating-iam-policies/012.gif?s=c5fb8fb177727512277c98a77aa318d8" alt="" width="1000" height="558" data-path="images/labs/creating-iam-policies/012.gif" />

### Completion and conclusion

1. You have successfully created an IAM Policy for EC2 Service.
2. You have successfully created an IAM Policy for S3 Service.
3. You have successfully created an IAM Policy for DynamoDB service.

### End lab

1. Sign out of the AWS Account.
2. You have successfully completed the lab.
3. Once you have completed the steps, click on **End lab** in the IP Lab Portal.

## What gets checked

When you press **Check my work**, the platform verifies each of these:

* **Create IAM Policies** — Check whether IAM Policies are created or not.

## Related help

* [FAQs and Troubleshooting](/aws-cp/support/faqs-and-troubleshooting)
