# Create a Managed Access

A Managed Access contains the necessary information to allow the service to access your AWS account to perform the necessary operations to deploy the Alluxio cluster. Because all resources are created within the user's AWS account, this sequence of steps must be completed before defining the Alluxio cluster. Learn more about the [split plane architecture](https://documentation.alluxio.io/rad/architecture-and-security/split-plane-architecture) to understand the purpose of this step.

{% hint style="info" %}
View the following tutorial video if it's your first time
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=2r7L2jbNsEo>" %}

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-02ff7edca5e032eb388908eebd6ad28d07521d6f%2Fimage%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

Click the Managed Access link in the left navigation bar to view the current set of Managed Access entries. Click the Add button to create a new entry.

## Step 1: Set AWS account ID

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-0e25892a89202278f023441889c19ab41aa40bb8%2Fimage%20(3)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

The first piece of information needed is your 12 digit AWS account ID. After logging into the AWS web console, you can find and copy this ID from the dropdown menu at the upper right.

## Step 2: Create IAM policy

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-457dd9f612d611742d14ce57ba4a0ed9c301b91e%2Fimage%20(4).png?alt=media" alt=""><figcaption></figcaption></figure>

Next we need to create an IAM policy that grants specific permissions; the policy definition is represented as a JSON document. Follow the instructions to go to the [Policies page](https://console.aws.amazon.com/iam/home#/policies). Click on Create Policy.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-5b492cddead654beef2411b6de391826b5d59d28%2Fimage%20(5).png?alt=media" alt=""><figcaption></figcaption></figure>

Click on the JSON button to switch the editor to an interactive text editor.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-f62403893fa8bfb104bd05d671ce4635e85d6add%2Fimage%20(6).png?alt=media" alt=""><figcaption></figcaption></figure>

From the RAD UI, click on Copy JSON to copy the policy text to clipboard. On the AWS console, replace the placeholder text by pasting the clipboard contents. Click Next to continue.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-b9dc882786d13676be341a57af758df5195e2e60%2Fimage%20(8).png?alt=media" alt=""><figcaption></figcaption></figure>

On the final screen, provide a policy name and click Create Policy to complete this step.

## Step 3: Create IAM role

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-9b423ac7dd7e13d348d1f2c463bc7cea294179c2%2Fimage%20(9).png?alt=media" alt=""><figcaption></figcaption></figure>

Finally we need to create an IAM role with the previously created policy attached. Follow the instructions to go to the [Roles page](https://console.aws.amazon.com/iam/home#/roles) and create a new role.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-cf2c9f5f4d400ccbf569dd01ec7b9cdf969e7de3%2Fimage%20(10).png?alt=media" alt=""><figcaption></figcaption></figure>

Click on `AWS account` as the Trusted entity type. In the below section that subsequently appears, select `Another AWS account` and paste the account ID `767397899727`

> The AWS account ID to set as the "Another AWS account" is our management AWS account we are using to issue the deployment commands to your AWS account.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-68c0545fcb6bc5996aa39e65c9cd91e6de765fce%2Fimage%20(11).png?alt=media" alt=""><figcaption></figcaption></figure>

Click on the checkbox for Require external ID and copy the external ID from the RAD UI. Click Next to proceed to the next section.

> The [external ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) is a recommended setting when delegating access to another AWS account.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-8db2bfe768c9fbe17c2d11585db5d8854050c9c2%2Fimage%20(12).png?alt=media" alt=""><figcaption></figcaption></figure>

Attach the previously created policy and click Next to proceed.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-da90cae208843f893524a061fef2c3a8ffa5ad3d%2Fimage%20(13).png?alt=media" alt=""><figcaption></figcaption></figure>

Provide a role name and click Create Role to complete this step.

## Create and validate managed access

On the overview page of the IAM roles, search for and click on the newly created role.

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-30e2d4f98726a4cbf10f68e0e46b2774e07250b3%2Fimage%20(14).png?alt=media" alt=""><figcaption></figcaption></figure>

Complete the creation of a Managed Access by providing

* The ARN of the newly created IAM role
* (already set) The external ID set for the IAM role
* The AWS region to deploy the cluster in (defaults to `us-east-1`)
* (For advanced users) Optionally, copy your SSH public key; used to grant SSH access to the cluster instances after deployment

After confirming the creation of the Managed Access, it will appear in the table of Managed Access entries.

{% hint style="info" %}
The managed access creation only succeeds after we are able to validate the IAM role by successfully authenticating to AWS with it.

If the operation fails, double check that the AWS account id in the role definition is `767397899727`and the External Id matches the one provided by the RAD UI. This information is found under the Trust relationships tab when viewing the details of the IAM role.

Note it can also take a few minutes for AWS to recognize the IAM role, especially if updating an existing role as opposed to creating a new one. If the information is correct but continues to fail to validate, wait a few minutes before trying again.
{% endhint %}

<figure><img src="https://3120376371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmrwbXqYrN8NJJz04XpWG%2Fuploads%2Fgit-blob-ad8494bcafb929943af17d28ccf5fd3c1881f7a5%2Fimage%20(31).png?alt=media" alt=""><figcaption></figcaption></figure>
