First steps with AWS Cloud9

Francisco Güemes
6 min readNov 27, 2023

--

What is AWS Cloud9?

AWS Cloud9 is an IDE that runs in the cloud as a SaaS. The user will access to Cloud9 through the browser and all the computational operations (file edition, compilation, etc …) will happen in the cloud.

AWS Cloud9 requires the user to have an AWS account and create a Cloud9 environment. In the context of Cloud9, the environment is similar to a user in a shared host (a machine with multiple concurrent users that connects to the machine remotely through a terminal).

The Cloud9 environment is created in an EC2 instance (a virtual machine in the AWS cloud). The underlaying EC2 instance is the machine that runs the IDE (Cloud9) and the machine that will store the files that are edited with the IDE.

When to use Cloud9?

There are many use cases for Cloud9, I find it particularly interesting for case where the task do not require big computational power in the remote instance that executes the Cloud9 environment. I.e. DevOps: developing Terraform configuration or a new pipeline. The edition of the files will take place in Cloud9 environment and the files will be executed with AWS CLI, but the really expensive computational operations (providing the hardware, or parsing and executing the pipeline definition) will happen in another set of machine(s) in AWS cloud.

When not to use Cloud9?

I personally would not recommend Cloud9 for heavy computational processes. I.e. Building a monolithic application of a million lines of code in a compiled language (Java, C++, etc…), this not only can take a long time (depending on the capacities of the associated EC2 instance), but it can be tedious and not optimal user experience.

Why is Cloud9 interesting?

Cloud9 is specially interesting because it allows to completely detach the working environment of many professional roles (DevOps, Cloud Engineer, Networking engineer, etc…) from the real hardware that the company provides. It does not matter any more which laptop the person is using, if it has a browser, it is fine.

It save time and money. Cloud9 allows the companies to save time by having the working environments of the cloud workers pre-configured, this not only save time in setting up the environmnet, but also speed up troubleshooting issues related with the setup.

It adds flexibility. With Cloud9 any computer with a browser and internet connection can be used to solve any task in the cloud, whether you are at home, at the office or anywhere.

Creating your first environment

Create your first environment with Cloud9 is really easy.

Enter in your AWS account and search for “cloud9”

Click on the button “Create environment”

In my case I am going to create an example environment creating also the EC2 instance that will contain the environment. But if you already have any EC2 instance or any other server machine, you could potentially create the environment in that machine.

I am selecting the most basic EC2 instance type for testing and showcasing purposes. This type of instance is contained in the free plan and therefore it will not cost me money.

It is important to highlight the option “Timeout”. This option hibernates automatically the instance if there is no cloud9 usage after a certain amount of time. I always recommend to activate this option to avoid extra costs.

Finally I selected the connection through SSM. I have no requirements of connecting through ssh to cloud9, so this is the safest and fastest option to configure.

Once I click the “Create” option, the operation will take a couple of minutes to be completed.

Once the environment has been created you can access your new environment by simply clicking on the link that says “Open”.

Using the environment

Once I opened my AWS Cloud9 environment I saw a screen similar to the following one.

Note that the view of Cloud9 is similar to an IDE (VSCode, IntelliJ IDEA, Eclipse, etc…) but in a web version.

In the welcome tab that is opened I was able to configure some visual aspects of Cloud9 and also to access to some basic tutorials.

In the down part of the screen there is a terminal window that it is possible to maximize, so I did it and I ran some basic linux commands. It is pretty much like executing a terminal window in your machine and connect using ssh to the EC2 instance, but without having to deal with passwords, certificates, or any other configuration.

Creating a new file

To test a bit more the environment I decided to create a text file.

As I mentioned in the file itself, all files created on Cloud9 are premanently stored inside the EC2 instance. So if you delete the environment or the instance, you are implicitly deleting the files.

As you can see in the picture, the new file I created appear in the left panel of the IDE, similar to the IDEs that you would execute in your local machine.

Having a look at the preinstalled tools

AWS cloud9 comes with AWS Command Line Interface ( AWS CLI ) pre-installed out of the box, but it also comes with many other tools such as git, java or node among many others.

Stopping the instance

When you finish working with AWS cloud9 instead leave the environment running until the automatic hibernation takes place, you can directly stop the EC2 instance associated to your environment. Same as you shutdown your laptop. By doing this you can save money and energy on the consumption of your EC2 instance.

In order to stop the EC2 instance associated to my Cloud9 environment, I decided to enter in the dashboard of my environmnet and click on “Manage EC2 instance”

Then in the EC2 Dashboard, I selected the instance associated with my cloud9 environment and chose the option “Stop instance”

I confirmed my decission.

While the instance was stopping I come back to the tab on which I had opened cloud9, and this is what I saw.

Summary

AWS Cloud9 can be an interesting alternative for many cloud roles (DevOps, SREs, Cloud Engineer, Cloud Network Developer, Networking Engineer, etc… ) on which computational power in the machine that runs the tools is not relevant to accomplish the task, but connectivity to the cloud environment and a pre-configuration setup (SSH keys, VPN connections, client tool configuration, etc …) is.

The future is here, AWS Cloud9 opens a entire new set of possibilities presenting an IDE as SaaS. It starts a new era on which even the development environments can truly be migrated and ran from the cloud.

--

--

Francisco Güemes

Java Back End Developer with focus on Cloud & Devops |AWS | Microsoft Azure | Google Cloud | Oracle Cloud