> For the complete documentation index, see [llms.txt](https://docs.nuvens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nuvens.cloud/install/alternate-deployment-options/deployment-from-shared-ami/iam-requirements-role-and-ec2-instance-profile.md).

# IAM Requirements: Role and EC2 instance profile

An **EC2 instance profile** allows an IAM role to be passed to an EC2 instance, granting it access to specified AWS services. For WorkSpaces Manager, this instance profile must include a role with the necessary permissions to access multiple AWS services, as described previously. These services include CloudWatch, Cost Explorer, EC2, EUC, Pricing, and S3, and the role must have custom policies that enable secure data retrieval from these services.

By attaching the role to the EC2 instance profile, WorkSpaces Manager will have the required permissions to perform its operations without needing manual credential management.

{% hint style="warning" %}
If using the [Git Repo for Terraform](https://gitlab.com/nuvens-public/iam-role-terraform) from Nuvens' public site, the **Security Group**, **Policies**, **Role**, and **EC2 Instance Profile** will be created together as part of the automated deployment process.
{% endhint %}

If you are creating the role manually, the custom policies must be created first. Once the policies are in place, follow these steps to create the role:

1. Navigate to **IAM > Roles** in the AWS Management Console.
2. Click on **Create Role**.
3. Select **AWS Service** as the trusted entity.
4. Under **Choose a use case**, select **EC2** and click **Next**.
5. Attach the previously created policies (e.g., **WSMCloudwatchPolicy**, **WSMCostExplorerPolicy**, **WSMEC2Policy**, etc.) to the role.
6. Proceed through the remaining steps and provide a name for the role, such as **WorkSpacesManagerRole**.
7. Complete the role creation process by clicking **Create Role**.

<figure><img src="https://1977539604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qADNWBPym2Zh4ZaguCE%2Fuploads%2FQqYnQq5EgcLD1RxWqzD8%2Fimage.png?alt=media&amp;token=d0f3d03b-c059-47f4-b7c1-60c1a1264442" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nuvens.cloud/install/alternate-deployment-options/deployment-from-shared-ami/iam-requirements-role-and-ec2-instance-profile.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
