We will be working with two key applications that you will learn to deploy on Amazon Elastic Container Service (ECS): a feature-rich core application and a complementary admin application. Understanding these applications will provide context for the ECS concepts and deployment steps we’ll cover.
The primary application is “Momentum,” a comprehensive to-do list manager. Users of the Momentum application can:
LOW
, MEDIUM
, HIGH
)TODO
, IN PROGRESS
, DONE
)The backend of Momentum is built using Spring Boot, leveraging the Spring MVC framework for rapid web application development. It uses a PostgreSQL database to store user and to-do data.
For managing database schema changes (migrations), Momentum employs Flyway. This is a deliberate and important choice for production-like deployments. Flyway allows database migrations to be version-controlled and applied deterministically, typically during the CI/CD build phase before the application itself is deployed. This approach is critical in a containerized environment like ECS, as it prevents potential concurrency issues and errors that could arise if multiple instances of the application (running in separate containers/tasks) attempted to apply the same database migration simultaneously upon startup.
The second application is a simple Admin Application designed as a dashboard. Administrators can:
The Admin application’s frontend is built using ReactJS.
A key learning objective for including the Admin Application in this workshop is to practically demonstrate Amazon ECS Service Connect. This ECS feature simplifies inter-service discovery and communication. You will configure Service Connect to enable the Admin application (running as one ECS service) to securely and easily consume the REST APIs exposed by the Momentum application (running as another ECS service).
Due to its focused role in demonstrating Service Connect, some advanced deployment aspects for the Admin application are optional:
The core exercises will concentrate on 3.8 Enabling Service Connect and 3.9 Deploying The Admin Application.
All the source code for both Momentum and the Admin application is available in this workshop’s GitHub repository, located within the /application
folder:
https://github.com/weebNeedWeed/ws-deploying-spring-ecs-fargate/tree/master/application
To familiarize yourself with the applications before deploying them to ECS, you are encouraged to run them locally using Docker Compose.
/application
directory within your cloned repository in your terminal.docker compose up -d
.This will build and start both applications in detached mode:
http://localhost:8080
.http://localhost:9090
.The default login credentials for both applications are: