Spring Boot Microservices in AWS CodeStar

Posted October 11th, 2018 by Harish KM 98 Views

AWS CodeStar is a managed service from AWS that lets us quickly develop, build & deploy C#, Go, HTML, Java, Node.js, PHP, Python & Ruby apps. This article explores using CodeStar to build Spring Boot microservices.

We begin at the CodeStar home page at https://console.aws.amazon.com/codestar/home. Create a New Project & choose the Java Spring Lambda Web Service template:

Enter Project Name & ID & click Next:

Review Project Details & Create Project:

Select AWS Cloud9 as our Code Editor & click Next:

Click Next:

We now arrive at our Project Dashboard. Wait for the Cloud9 environment to finish creating. Once that’s done, we need a way to try out our brand new microservice. Add the App Endpoints tile to the Dashboard:

Open the App Endpoint in a new tab to see the output:

{
    "Output": "Hello World!"
}

Let’s try changing this! To get to our code, switch to the IDE tab & click Open IDE:

In the IDE, open HelloWorldHandler.java & change “Hello World!” to “Hello World 2!”:

Do the same in HelloWorldHandlerTest.java:

Commit & Push these changes:

Wait a few minutes for the automated Build & Deployment to finish. Now reopen the App Endpoint to see the change we made:

{
    "Output":"Hello World 2!"
}

This was a simple example demonstrating the power of CodeStar. The code can be further elaborated to create full-fledged microservices!

 

(Part 1/3 in AWS series)


“Harish KM is a consultant at Systems Plus. The content of this blog is personal & for information purposes only, and is subject to change. Reader discretion is advised”


Leave a Reply

Your email address will not be published. Required fields are marked *

Related