Use Cloud9 IDE

Overview

Cloud9 is a Cloud based IDE that you can provision directly from your AWS account. It includes a code editor, debugger, and terminal. For the purposes of this lab, the terminal is the key feature we want - Cloud9 will give you a simple terminal you can use without having to manage an instance, client installs, etc.

For this lab, we will use the Cloud9 IDE terminal as a bastion host of sorts - the Cloud9 environment will allow you in through your browser and give you a shell, from which we will connect to the KafkaClientInstance, where all the main Kafka tools are installed.


Prerequisites

If you’ve provisioned your lab account using the suggested Cloudformation template then Cloud9 is already setup and ready to go for you! Carry on!

If you haven’t used that Cloudformation template, but you still want Cloud9 setup, checkout setup cloud9 for those steps before following this document.


Using Cloud9

  1. In the AWS Console, go to the Cloud9 service

  2. Click on the Cloud9EC2Bastion and then click Open IDE


UI Overview


  1. In the intro UI, Click on Select files. Pick the EC2 pem file that you created in the Prerequisites section. Click Open. The file will be copied to the /home/ec2-user/environment dir and will also be visible in the left pane.


If the Intro UI is gone or you can’t figure out how to upload the PEM file, click on File then Upload Local Files..., select the PEM file in the local filesystem and they will be uploaded


  1. Go to the bash pane at the bottom and type in the following commands to setup the ssh environment so that you can access the KafkaClientEC2Instance.

    chmod 600 <pem file>
    eval `ssh-agent`
    ssh-add -k <pem file>
    

Note that you can drag the panel border above the bash window up to give you a bigger shell - you won’t really need the editor panel for this lab

  1. You can now use ssh to connect to your KafkaClientInstance to work on your lab activities

Connecting to an instance via SSH

  1. In your bash pane, you will use standard ssh to connect to the IP address of your instance. For most labs, this will be your KafkaClientInstance. An example of this:

     ssh -i ~/<pem file> ec2-user@<instance IP>
    

    in reality, that would like something like this:

     ssh -i ~/msklab.pem ec2-user@10.0.1.193
    

    (The IP Address will be different in your account - the above is just an example. Refer to Connect to KafkaClientInstance for details on getting the KafkaClientInstance and how to get the IP address.


Configurating Cloud9

If you want to modify your Cloud9 environment, you can open up the Preferences (Click on the Cloud9 icon, then Preferences) to adjust many settings