Implementing an application using AWS Code Commit and Cloud9

Filipe Pacheco
4 min readDec 12, 2023

--

Hello Medium readers,

After an almost one-month hiatus, I’m back on the Medium blog to share my latest adventures in the realm of DevOps. During this time, I’ve been exploring new AWS services that I haven’t had the chance to use before, so let’s dive right in.

Task of the day

In this project, based on a real-world scenario, I implemented Git repositories for application and infrastructure code using AWS CodeCommit. I gained hands-on experience with the Proof of Concept (PoC) process, focusing on committing, pushing, and reverting code changes.

My mission was to establish a Git repository using AWS CodeCommit for HumanGov, a hypothetical Software as a Service company catering to government organizations. While I’ve previously covered Git & GitHub in this post, I’m now delving into two new services: AWS CodeCommit, an equivalent to GitHub, and AWS Cloud9, an IDE comparable to VSCode.

Services used in this implementation.

Implementation step by step

In the image below, I present the proposed solution architecture designed to facilitate the DevOps framework in the development of future applications. As depicted, there are two distinct repositories, each serving specific use cases.

The first repository, named “human-gov-application,” is intended for access by development teams. The second repository, named “human-gov-infrastructure” is designated for use by DevOps engineers, with the goal of ensuring the continuous operation and maintenance of the application.

Solution Architecture proposed.

Creation of AWS CodeCommit repository

Creating a repository in AWS CodeCommit is a straightforward process. Simply navigate to the AWS console, search for CodeCommit, and click on it. Once there, click the orange “Create repository” button. You’ll then need to choose a name for the repository and provide an optional description. After completing these steps, you’ve successfully created your first repository. As mentioned earlier, I created two repositories as part of this process.

AWS CodeCommit repository view.

In the image above, you can find the links essential for cloning the repository into your local development environment. For today’s task, my “local development environment” is AWS Cloud9.

AWS Cloud9

As I mentioned earlier, Cloud9 is the private IDE created by AWS. Up until now, all my development work has been carried out using Git bash or VSCode installed on my personal computer. The significant challenge when using my personal computer as a development environment lies in the need to manage all the installations and requirements from the DevOps realm, including Git, Terraform, Ansible, Docker, and more.

With the Cloud9 IDE, AWS takes care of all these requirements and more, allowing me to spend more time programming and less time on management tasks. Under the hood, AWS creates a dedicated EC2 instance to host this IDE.

Creating a Cloud9 environment is also a straightforward process. Simply search for Cloud9 in the AWS console, click on it, and once there, click the orange “Create environment” button. In the image below, I provide a snapshot illustrating the selections you need to make in order to deploy the EC2 instance configured as an IDE. While it may seem simple and straightforward again, it truly is.

AWS Cloud9 Creation view.

Once the environment is created, you can click to open it, and a new tab will appear, allowing you to access your environment. Initially, it’s necessary to configure your environment, and for the most comprehensive documentation on that, I found it here. Just read through the text, and it will be easy to set up everything.

AWS Cloud9 IDE view.

After this, I followed the instructions to deploy the application — cloning, adding, committing, pushing, reverting, and pushing again, as demonstrated in the Commit view inside the repository I created, human-gov-application.

AWS CodeCommit Commits view.

Conclusion

In summary, I still on the journey to enhance my DevOps practices within AWS, adopting new services like CodeCommit and Cloud9. Establishing Git repositories, I crafted a specialized environment using AWS Cloud9, simplifying development by offloading management tasks to AWS.

Having configured my Cloud9 environment, I seamlessly executed deployment tasks, showcasing the entire process from cloning and committing to pushing and reverting in the human-gov-application repository. This experience not only streamlined development but also highlighted the efficiency of AWS services in optimizing the DevOps workflow.

I hope you liked this quick demo and follow me to learn more.

--

--

Filipe Pacheco

Senior Data Scientist | AI, ML & LLM Developer | MLOps | Databricks & AWS Practitioner