
This document describes the CI/CD deployment process for the Usheru Notification Service as represented in the architecture diagram. The deployment is fully automated using AWS CodePipeline, ECS, and supporting AWS services.
1. Source Control
Repository: GitHub –
usheru-notificationBranches:
main branch → triggers production pipeline
test branch → triggers development pipeline
Whenever a commit is pushed to either branch, AWS CodePipeline is triggered to begin the deployment process.
2. AWS CodePipeline Flow
a. Source Stage
CodePipeline retrieves the latest source code from GitHub.
The code is stored in an S3 bucket (
codepipeline-eu-west-1/SourceArtifact) as the source artifact.
b. Build Stage
The build process compiles the code, builds a Docker image, and runs automated tests.
On success:
Build artifacts are stored in S3 (
codepipeline-eu-west-1/BuildArtifact).A new Docker image is pushed to the Amazon ECR repository (
usheru-notification ECR repo).
c. Deploy Stage
A new ECS task definition is generated using the latest Docker image.
ECS deploys a new service with the updated container(s).
Deployment targets are Elastic Container Service (ECS) on EC2 instances.
Ideal deployment configuration:
Development → 1 container instance
Production → 2 container instances (for availability and scalability)
3. Networking & Load Balancing
ECS tasks run on an EC2 Target Group.
Each ECS service task is registered with an Application Load Balancer (ALB).
The ALB:
Balances traffic across ECS tasks.
Is registered as a CNAME record in Route 53 for external DNS resolution.
4. Endpoints
Production Endpoint: https://notification.usheru.com
(resolves via Route 53 → ALB → ECS container(s))
Development Endpoint: https://notification.develop.usheru.com
(resolves via Route 53 → ALB → ECS container)
5. Deployment Workflow Summary
Developer commits code to GitHub (
mainortestbranch).CodePipeline detects the commit and pulls the source.
Build stage: Docker image is built, tested, and pushed to ECR.
Deploy stage: ECS creates a new task definition and redeploys the service.
Application Load Balancer routes traffic to the updated ECS containers.
Route 53 DNS directs users to the correct environment (dev/prod).
6. Key Benefits
Automated CI/CD pipeline – from commit to deployment.
Immutable deployments – new Docker image for each release.
Scalability – ECS with load balancer and multiple containers for production.
Environment isolation – separate dev and prod pipelines and endpoints.
High availability – ALB and multiple ECS containers ensure reliability.