DEV Community

Cover image for Cloud9 starter guide with Spring Boot
Indika_Wimalasuriya for AWS Community Builders

Posted on • Edited on

Cloud9 starter guide with Spring Boot

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:

AWS Cloud9

[Cloud9]

  1. Navigate to AWS Cloud9 -> Environments -> Create Environment.
  2. Configure Environment Details: Choose "New EC2" as the environment type.
  3. Choose the Platform: Opt for "Amazon Linux 2."
  4. Define the Timeout Settings.
  5. Specify Network Settings: Decide between using SSM (Systems Manager) or SSH.
  6. Configure VPC and Tags.
  7. You're all set! Click "Create" to begin.

Cloud9 Environment

[Cloud9 Environment]

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 related to EC2

[Cloud9 associated EC2]

Click "Open," and you'll have your newly created AWS Cloud9 development environment.

Coud9 - IDE

[IDE]

Let's create our first Spring Boot project:

  1. Begin by creating a folder named "SpringBootMicroservice" using the following terminal commands:
mkdir SpringBootMicroservice
cd SpringBootMicroservice
Enter fullscreen mode Exit fullscreen mode

Terminal Output
[Terminal Output]

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
Enter fullscreen mode Exit fullscreen mode

Termina Output
[Terminal Output]

  1. Next, download and install Java with the following commands:
sudo yum update
sudo yum install java-17-amazon-corretto-devel
Enter fullscreen mode Exit fullscreen mode

Terminal Output
[Terminal Output]

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.

  1. Now, proceed to create your Spring Boot project by creating the associated model, repository, and services components.

Spring Boot Project
[Spring Boot Project]

  1. 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:

./gradlew build
Enter fullscreen mode Exit fullscreen mode

Build automation

[Build automation]

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.

Top comments (3)

Collapse
 
srini2024 profile image
Srinivasan

Superb Article

Collapse
 
indika_wimalasuriya profile image
Indika_Wimalasuriya

Thank you. Appriciate your feedback.

Collapse
 
manojpoosalingam profile image
Manoj

Good article with steps