# AWS - Roles (Assume Role)

#### Step 1: Create the Role

1. **Sign in** to the AWS Management Console.
2. Navigate to **IAM** > **Roles**.
3. Click **Create role**.
4. Select **Another AWS account** under "Trusted entity" and enter the Account ID of the trusted account.
5. Choose the permissions for the role (either attach policies directly or use a custom policy).
6. Provide a **Role name** and click **Create role**.

#### Step 2: Grant Permissions to Assume the Role

1. In the **Account that will assume the role**, go to **IAM** > **Policies**.
2. Create or select a policy that grants the `sts:AssumeRole` action on the role.
3. Attach the policy to the IAM user or group that needs to assume the role.

#### Step 3: Assume the Role

1. In the **trusted account**, use the AWS CLI, SDK, or Console to assume the role

***



#### POC :&#x20;

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2FbeMU0pHJPI9l51iixzpH%2Fimage.png?alt=media&#x26;token=ccaaf2c0-af99-4117-b3ad-28dcbbd90f84" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2FXDrpYx6Nxc7uy7pEi7K4%2Fimage.png?alt=media&#x26;token=ab95f130-a741-42f3-986e-bd42cbf25c2a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2FMUn7wGg910Wna51BLBMY%2Fimage.png?alt=media&#x26;token=7e9888c2-f197-43a0-9946-17a9263c5bc0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2F56Ms7pTrbLLaB7taxv4N%2Fimage.png?alt=media&#x26;token=57e0a861-7dcf-4cee-9a1a-ab15ee332032" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2FO297yAcCX6LUREso9sGc%2Fimage.png?alt=media&#x26;token=9d28bc7b-7996-4ff1-99c0-ae5dfcce731a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2F1QVqr01XVfpxBlgglAc3%2Fimage.png?alt=media&#x26;token=1b266400-79a0-4c2c-9d9f-a200b0f6a565" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2FC4XxabHlypGFBIGBZb1r%2Fimage.png?alt=media&#x26;token=b2d5be76-d588-43e7-be8e-1d68fa4e20d2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2F93EtOd9ZlKPvr28M2WLS%2Fimage.png?alt=media&#x26;token=ac9403e6-3fa7-4e9c-b3d8-9dddbf812b63" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2F9uZarY74QfmYoXQf6m8x%2Fimage.png?alt=media&#x26;token=0f34bf33-71df-42ef-aeed-065d36ecf276" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2F71VU13qM0HPHzV0YEUvO%2Fimage.png?alt=media&#x26;token=4a4f3867-a52d-4294-aaad-180d2a39bb77" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2FeKATlrwTrr6RHJCfvnAK%2Fimage.png?alt=media&#x26;token=9b0d2667-e5dc-44de-a014-d5bb644de7f7" alt=""><figcaption></figcaption></figure>
