---
title: "Creating the EKS Cluster"
weight: 31
---
In the following module, you will complete the outcomes listed below:
1. Access and Configure an AWS Cloud9 IDE
* AWS Cloud9 is cloud-based integrated development environment (IDE) that lets you write, run, and debug code all within the browser.
2. Create a 3 node Amazon EKS Cluster with a provided cluster config.
---
## Step 1: Access the Cloud9 IDE
Let's start by accessing the Cloud9 IDE.
If you are at an event using Workshp Studio, navigate to the AWS Console by clicking **Open AWS console** on the left
nav bar of the workshop page.

Access the Cloud9 service by searching for it in the menu bar at the top of the screen:

When the main Cloud9 screen opens, click on **Open** under **Cloud9 IDE**

Once the IDE has loaded, we recommend you use the **+** button and select **New Terminal** to open a new full screen terminal window.

You can close the smaller terminal window at the bottom if you'd like. Welcome to Cloud9!

## Step 2: Set up your Cloud9 Environment
Using AWS Workshop Studio
::::expand{header="Using AWS Workshop Studio"}
### Download the env-setup.sh file:
The setup script will install (or update) a few tools and set environment variables in the Cloud9 IDE.
* Run **curl** command in the Cloud9 terminal:
```bash
cd
curl ':assetUrl{path="env-setup.sh" source=s3}' --output /tmp/setup.sh
```

### Run the setup script
* Run **env-setup.sh**:
```bash
cd
. /tmp/setup.sh
```

### Download the cluster config:
The cluster config file defines the EKS cluster settings and permissions for the cluster.
* Run the **curl** command in the Cloud9 terminal):
```bash
curl ':assetUrl{path="eksctl-cluster.yml" source=s3}' --output ~/eksctl-cluster.yml
```

::::
Using Personal AWS Account
::::expand{header="Using Personal AWS Account"}
### Upload the required files:
Upload the **env-setup.sh** and **eks-cluster.yml** files that were downloaded in the **Workshop Environment** section of the instructions to the Cloud9 environment
The setup script will install (or update) a few tools and set environment variables in the Cloud9 IDE.
* Upload the required files
You can upload files directly to your Cloud9 environment using drag and drop
* Click **File** in the top left of the Cloud9 environment
* Click **Upload Local Files...**

* Drag and drop the eks-cluster.yml and env-setup.sh files into the **Upload Files** pop-up window

* Verify File upload

Though files upload to the **environment** directory, it's somewhat more straightforward to work in the home directory.
* Run **copy** command in the Cloud9 terminal:
```bash
cd
cp environment/env-setup.sh /tmp/
cp environment/eksctl-cluster.yml .
```

### Run the setup script
* Run **env-setup.sh**:
```bash
cd
. /tmp/env-setup.sh
```

::::
## Step 3: Update Cloud9 Instance
In order to give our Cloud9 IDE instance permission to create an EKS cluster we
must change the IAM role the instance is using to one with the correct permissions.
### Disable Cloud9 temporary credentials:
* Click the cog wheel in the upper right of the Cloud9 IDE

* Click the AWS Settings section on the left of the settings window

* Switch **AWS Managed Temporary Credentials** to the **off** position

* Close the settings window
### Modify Cloud9 instance IAM Role
* Click the profile circle (for Workshop Stuio, it will be **W**) in the upper right of the Cloud9 IDE

* Click **Manage EC2 Instance**

* Select instance (only 1 showing)

* Open Submenus for **Modify IAM role** under **Actions**

* Choose **eksctl-creator** from drop-down

* Click **Update IAM Role**

## Step 4: Create the cluster
```bash
envsubst < ~/eksctl-cluster.yml > ~/eksctl-cluster-actual.yml
eksctl create cluster -f eksctl-cluster-actual.yml ; eksctl create iamidentitymapping --cluster $EKS_CLUSTER_NAME --region=$AWS_REGION --arn $rancherUser --group system:masters --username rancher
```


> **Note: Cluster creation can take up to 25 minutes**


## Completed!
We're done! You've just created an AWS EKS Cluster using `eksctl` and the AWS Cloud9 IDE. Let's move onto creating the RKE2 Cluster!