Skip to main content
Welcome back. In this lesson we implement continuous deployment for both microservices and verify that commits pushed to each repository are automatically built and deployed to ECS via CodePipeline — without manual intervention.

Overview

The original monolithic application has been split into independent microservices. Each microservice lives in its own repository and is built, tested, and deployed independently. This architecture enables faster releases, isolation of failures, and autonomy for different teams. Below is a diagram that illustrates the migration from a monolith to microservices and how AWS CodePipeline and Amazon ECS work together in the CI/CD flow.
The image illustrates the process of moving from a monolithic architecture to microservices using AWS Cloud services. It shows how applications are built and deployed via AWS CodePipeline and Amazon Elastic Container Service, with an Application Load Balancer distributing traffic.
What we’ll do in this lesson:
  • Make small UI changes to the product page and the login page.
  • Commit and push those changes to each microservice repository.
  • Watch CodePipeline detect the changes, build Docker images, and update the ECS services.
  • Verify the new versions are served by the Application Load Balancer.

Changes made

I used the Cloud9 IDE to edit both microservice repositories. Below are the final files I saved for each service.

Product microservice — templates/product.html

This is the polished, production-ready product page that was committed to the product microservice repository:

Login microservice — templates/login.html

I updated the login button text and improved inline styles for clarity. The final saved login.html:

Commit and push (triggering pipelines)

After editing the files, I staged, committed, and pushed changes in each repository from Cloud9. The push to AWS CodeCommit triggered the associated CodePipelines. Product microservice — example terminal steps:
Login microservice — example terminal steps:
Pushing these commits started the pipelines in CodePipeline automatically.
The image shows the AWS CodePipeline interface with two pipelines, "login-page-microservice" and "crypto-app," both currently in progress. It includes details such as source information and execution status.

Monitor pipeline progress and verify deployment

I opened each pipeline in the AWS Console and watched them progress through the standard stages: Both pipelines progressed through Source → Build → Deploy automatically. When the build completed, new ECS task definitions were registered and the ECS services were updated. To verify the login UI change:
  1. Open the ECS service for the login application.
  2. Click “View Load Balancer” and copy the load balancer DNS name.
  3. Open the DNS in your browser.
During a rolling deployment you may briefly see the old and new UI versions as the load balancer routes traffic between old and new containers. This is expected behavior until draining and health checks finish.
During a rolling deployment, you may briefly see both old and new versions as the load balancer routes traffic between container instances. This is expected until old tasks are drained and the new tasks pass health checks.
After the deployment finished, the login button consistently showed “Application login.” I logged in with valid credentials and was redirected to the updated product page — confirming both microservices were independently deployed and working together.

Why this approach matters

Key takeaways

  • Continuous deployment was implemented for both microservices using CodeCommit → CodePipeline → CodeBuild → ECS.
  • Each service has an independent pipeline; pushing to a repository triggers only that service’s pipeline.
  • Rolling ECS deployments can show temporary mixed versions while tasks are being replaced — this is expected.
  • Microservice architecture enables faster iteration and independent team velocity.
That concludes this lesson. See you in the next article.

Watch Video