AWS Cloud9 is a cloud-based integrated development environment (IDE) offering numerous advantages. It facilitates effortless code collaboration, making it ideal for distributed teams. With its preconfigured AWS tools and secure cloud environment, developers can enhance productivity, streamline workflows, and accelerate innovation.
Here are the top 5 advantages of AWS Cloud9:
- Browser Accessibility Anywhere: You can access it via a web browser from anywhere with an internet connection.
- Real-Time Collaborative Coding: It supports real-time collaborative coding, enhancing teamwork.
- Direct AWS Terminal Access: This unique feature allows direct terminal access to AWS, which I personally find very cool.
- Serverless Development Support: It supports serverless development, simplifying the process.
- Rapid Project Start: You can quickly bootstrap a new project with ease.
Let's initiate a Spring Boot project swiftly using AWS Cloud9:
- Navigate to AWS Cloud9 -> Environments -> Create Environment.
- Configure Environment Details: Choose "New EC2" as the environment type.
- Choose the Platform: Opt for "Amazon Linux 2."
- Define the Timeout Settings.
- Specify Network Settings: Decide between using SSM (Systems Manager) or SSH.
- Configure VPC and Tags.
- You're all set! Click "Create" to begin.
Before launching Cloud9, it's crucial to ensure that the associated EC2 instance is up and running. Any issues with the EC2 instance can lead to problems with Cloud9, and more often than not, the most common reason for Cloud9 not loading is related to issues with the EC2 instance.
[Cloud9 associated EC2]
Click "Open," and you'll have your newly created AWS Cloud9 development environment.
Let's create our first Spring Boot project:
- Begin by creating a folder named "SpringBootMicroservice" using the following terminal commands:
mkdir SpringBootMicroservice cd SpringBootMicroservice
2.Utilize Spring Initializer to generate a Spring Boot project for "SpringBootMicroservice":
curl https://start.spring.io/starter.zip -o project.zip unzip project.zip rm project.zip
- Next, download and install Java with the following commands:
sudo yum update sudo yum install java-17-amazon-corretto-devel
Please note that Spring Boot's Gradle plugin requires Gradle 7.x (7.5 or later) or 8.x, and Java 17 or a higher version.
- Now, proceed to create your Spring Boot project by creating the associated model, repository, and services components.
- Let's proceed to build the project using Gradle.
Gradle is a widely adopted open-source build automation tool. It offers flexibility and efficiency in handling project dependencies, task definitions, and automating the build process.
To initiate the build process, execute the following command:
That's it. We have successfully created a Spring Boot project in Cloud9.
Lastly, let's discuss Cloud9 pricing. There are no additional charges for using Cloud9 itself. Instead, you'll be billed for the services you utilize, such as EC2 instances, and so forth. If you're within the free tier for EC2, there will be absolutely no cost. A key reminder: always remember to shut down your EC2 instances when you've completed your work to avoid any unexpected charges.