Cloud9 from AWS 🚀: pt 1
Tags: aws, cloudcomputing, machinelearning
Published: 2023-07-14 01:20:52

Cloud9 is an browser-based IDE for the AWS Cloud. History Cloud9 has been overlooked by developer who preferred the comforts of VS Code, WebStorm, or Sublime as their IDE of choice. However of late Machine Learning experimentation has boosted Cloud9 usage.

---- 
Getting Started:
----

Getting started with Cloud9 is as simple as logging into a your account, navigating to the Cloud9 service (found by searching for _Cloud9_ in the navbar). And clicking the self-explanatory `Create environment` button. 

![Start button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ukhf5v4mdzi5ch19g63.png)

To host Cloud9 on EC2, select a base image type (Amazon Linux 2 is available), instance size (from t2.micro up to M and C sizes, suitable for computationally intensive application). And there is an option to modify the timeout of 30 minutes which shuts down an idle Cloud9 session to reduce cost. Advanced configurations including VPC placement and modifying the instance role are also available. 

For anyone who has used a remote desktop before, you may have a few reservations. Remote desktops can be slow enough and as difficult to use. Cloud9 has a crispy UI and the ability to modify the host EC2 instance (including increasing instance storage). 


-----
Using the Debugger
-----

Cloud9 covers the basic functionality of all IDEs including the ability to debug code in the IDE. To open a Debug session in Cloud9, click the debug icon on the right menu.
 
![Debug Menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7j70vr0tmo1b97awf7fu.png)

Within the debug menu, application state can be examined by inserting breakpoints in the application code. In-scope variables can be watched to show changes during code execution.

For example, consider this simple js file, which logs the value of the `iteration` variable as it increments from 0 to 4. 
```
var iteration = 0

while (iteration < 5) {
    console.log("iteration: " + iteration)
    iteration += 1
}
``` 

By adding a breakpoint in the while loop, and watching the `iteration` variable, the debug panel updates the variable state on each step through the while loop. 

![Breakpoint placement](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iq78hf5mfyer6s1u2soo.png)

Initially the `iteration` value is 0.

![Initial debug](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wvibpgl2qdetxq7xixsj.png)

After stepping through the loop once, the incremented value of the watched variable `iteration` is updated in the debug console.

![First iteration debug](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jb4eg4wy3w2t7qtzdv3.png)


----
AWS Resource Integration
----
Besides the File Explorer and Source Control functionality - one of the coolest features of Cloud9 is access to AWS resources from within the IDE. Using the command line from the Cloud9, the aws-cli is configured with permissions to access AWS resources (this role can be modified for fine grained security). For example running `aws s3 ls` from the terminal will list s3 buckets. 


![AWS S3 creation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ju6j5ofceo2qz3vayurm.png)

Account AWS resources can also be administered through the Explorer panel on the left menu. In this case an S3 bucket can be created via the UI. While this was a simple exploration to get your feet wet, Cloud9 provides a great cloud IDE. 🚀

[Pt 2: Launching Code Whisperer](https://dev.to/andrewtdunn/cloud9-from-aws-pt-2-3faf)