Creating a Cloud9 environment

1. Creating a Cloud9 environment

AWS Cloud9 is a cloud-based integrated development environment (IDE) that allows you to write, execute, and debug your code. If you would like to know more details, please refer to here.

Select Cloud9 from the AWS Management Console.

Cloud9

Select Create environment

Cloud9

Enter something similar to {name}-ddmmyyyy. Finally, select Next step at the bottom right.

Cloud9

Choose the following environment settings and scroll down:

  • Environment type Create a new EC2 instance for environment (direct access)
  • Instance type m5.large (8 GiB RAM + 2 vCPU)
  • Platform Ubuntu Server 18.04 LTS and scroll down

Cloud9

Click the triangle to expand the Network settings (advanced) section. Choose your default VPC or any VPC that has a public subnet. Next choose a public subnet and finally select Next step. If you do not have VPC with public subnet please follow the instructions here to create one

Cloud9

On the Review screen, select Create environment at the bottom right to start Cloud9. It will take a few minutes to start.

When the Cloud9 environment starts up, the following screen or similar will be displayed.

Cloud9

If you don’t see this screen after waiting a few minutes, it’s possible that you’re using a browser other than Chrome or Firefox, or that the subnet of your selected VPC isn’t public (not connected to the Internet). Please recreate the Cloud9 environment again.

Now we have a Cloud9 environment.

2. Disk capacity expansion

An EBS volume with a capacity of 10GB is attached as storage to the EC2 instance linked to the created Cloud9 environment. If you proceed with this hands-on procedure, the disk capacity may become insufficient, so use this procedure to expand the disk capacity.

First open a new terminal as shown below:

Cloud9DisableTempUser

Run the following command to update your AWS CLI to latest:

curl https://aws-iot-workshop-artifacts.s3-eu-west-1.amazonaws.com/resources/2021-03-31/src/customScripts/updateCLI.sh | sh

Once thats complete let’s run the following command in a Cloud9 terminal to expand Cloud9’s disk space and restart your Cloud9 instance.

curl https://aws-iot-workshop-artifacts.s3-eu-west-1.amazonaws.com/resources/2021-03-31/src/customScripts/resize_volume.sh | sh

While the instance is restarting, Reconnecting ... will be displayed, so please wait until the instance restart is completed. After the instance restarts, open a new terminal in Cloud9 and run the following command to check the disk space.

df -h

In the command execution result, check that / is 45GB or more as shown below.

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1   49G  7.9G   41G  17% /

3. Disable AWS Cloud9 temporary credentials

Cloud9 uses temporary credentials by default. Let’s disable them as we will be using our own IAM user or Event engine provided credentials.

First open Preferences under the Cloud9 icon and navigate down to AWS Settings in the bar on the left. Then uncheck ‘AWS managed temporary credentials’.

Cloud9DisableTempUser Cloud9DisableTempUser

Once done, please close the Preferences tab

That’s all for this procedure.

If you encounter any issues during the workshop, first see if you can find your solution in Troubleshooting section