Create Cloud9 Workspace

Cloud9 environment initialization takes about 5 minutes

Create Cloud9 Workspace

  1. Go to AWS Console
  • Find Cloud9
  • Select Cloud9

Create workspace

  1. In the Cloud9 interface
  • Select Create environment

Create workspace

  1. In Name environment step
  • Enter Name: eksworkshop
  • Select Next step Create workspace
  1. In Configure settings step
  • Select Create a new EC2 instance for environment (direct access)
  • Select Instance type, select t3.small (2 GiB RAM + 1 vCPU)
  • Select Platform, select Amazon Linux 2 (recommended)

Create workspace

  1. Select Next step

Create workspace

  1. Check again and select Create environment

Create workspace

  1. Interface after creating the environment

Create workspace

  1. In the environment interface just initialized
  • Select Window
  • Select New Terminal

Create workspace

  1. Run the following script to increase Cloud9 Workspace capacity to 30 GB.
  • Copy the following command and paste it into the terminal interface on your workspace.
  • After executing the commands, Cloud 9 Workspace will restart.
pip3 install --user --upgrade boto3
export instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
python -c "import boto3
import os
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
volume_info = ec2.describe_volumes(
    Filters=[
        {
            'Name': 'attachment.instance-id',
            'Values': [
                os.getenv('instance_id')
            ]
        }
    ]
)
volume_id = volume_info['Volumes'][0]['VolumeId']
try:
    resize = ec2.modify_volume(
            VolumeId=volume_id,
            Size=30
    )
    print(resize)
except ClientError as e:
    if e.response['Error']['Code'] == 'InvalidParameterValue':
        print('ERROR MESSAGE: {}'.format(e))"
if [ $? -eq 0 ]; then
    sudo reboot
fi
  • Interface when running commands

Create workspace

The environment will be restarted when running the above command

  1. Complete initialization Cloud9 Workspace

Create workspace