Access and prepare the AWS Cloud9 IDE

Access your AWS Cloud9 environment by clicking the link right from AWSCloud9URL in the Outputs section of your CloudFormation stack.

You should see a website looking similar to the screenshot (colour scheme might look different):

AWS_Cloud9

Disable AWS managed temporary credentials

For an AWS Cloud9 EC2 development environment, AWS Cloud9 makes temporary AWS access credentials available to you in the environment. However for the workshop permissions from the IAM role attached to the Cloud9 instance should be used. Therefor you must disable AWS managed temporary credentials:

  1. Choose AWS Cloud9 or the 9-Symbol in the menu bar
  2. Preferences
  3. AWS Settings
  4. Credentials
  5. AWS managed temporary credentials: disabled

Show Files in Home Folder

Several files and folders have been copied to your AWS Cloud9 environment into the home folder of the ec2-user. To show them in the left pane of AWS Cloud9 choose the gear icon and then choose Show Home in Favorites.

Opening a Terminal in Cloud9

The Cloud9 IDE offers a builtin terminal that is used to type commands on the EC2 instance. A terminal can be opened in the following way:

  • Click the + in the tab-bar
  • New Terminal

Bootstrapping

To prepare the AWS Cloud9 instance for workshops a bootstrapping process will run shortly after the instance has been created.

If you access AWS Cloud9 shortly after it was created bootstrapping might still be in process.

  • If the file /tmp/BOOTSTRAPPING_IN_PROGRESS exists bootstrapping is in progress
  • You can find the output of the bootstrapping process in /tmp/c9-user-data.log. In the log file you will find information about the bootstrapping process like installing packages or configuring the system. When the bootstrapping process is finished the instance will be rebooted and you should see log entries similar to:
=== CLEANING /home/ec2-user ===
=== CLEANING /tmp ===
=== root should not use awscli ===
=== REBOOTING instance with at ===
/tmp/tmp.0EvwwK5ko7
Day Mon DD HH:MM:SS UTC YYYY
  • At reboot the connection to the Cloud9 IDE is lost. If you are not reconnected automatically after a minute or so reload the page to regain access to the Cloud9 IDE.

Copying Files from/to the EC2 instance

Files could either be uploaded directly with the Cloud9 IDE or indirectly via an S3 bucket.

Cloud9 IDE
  • Upload a file: In the menu choose File -> Upload Local Files…
  • Download a file: Right-click on the filename -> Download
S3

The CloudFormation stack has created a S3 Bucket for you. You can find the bucket name in the outputs section of the CloudFormation stack. A shell variable named “$S3_BUCKET” also holds the name of the bucket.

Use the S3 bucket to copy files to/from your EC2 instance. The AWS S3 console can be used to up/download files to/from the S3 bucket.

In a terminal in the Cloud9 IDE you would use the awscli to copy files to/from the bucket.

# copy files from the bucket
aws s3 cp s3://$S3_BUCKET/my_object .

# copy files to the bucket
aws s3 cp my_file s3://$S3_BUCKET/my_file