Skip to content

Dockerized exppress js app and sqs worker with CI/CD Code Pipeline Deployed on ECS and using service connect to communicate with each other

Notifications You must be signed in to change notification settings

saifkhan192/aws-cloudformation-ecs-container-load-balancer

Repository files navigation

CI/CD Pipeline on AWS environment with dockerized express js/ts app and a SQS queue worker

Tools

  • Docker / ExpressJs / AWS SDK for JavaScript
  • AWS S3
  • AWS SQS
  • AWS CloudWatch Logs
  • AWS CodePipeline
  • AWS CodeCommit
  • AWS Elastic Container Registry (ECR)
  • AWS EventBridge / EventBridge Rules / EventBus
  • AWS Elastic Container Service (ECS)
    • Clutser
    • Service
    • Task
    • Service Connect
    • AWS Cloud Map (or Namespaces)
  • AWS Elastic Load Balancer (ELB)

Project

To deploy nodejs express application using Docker engine and multiple AWS serivices.

Files

Workflow

  • Source code is stored in Github
  • When source code is updated with new push event, the pipeline is triggered. Below are the list of different stages of pipeline.
    • Build:
      • AWS uses buildspec.yml file to build the image with the Dockerfile
    • Push:
      • Docker image is pushed to ECR Registry
    • Deploy:
      • Docker image is used to run a container in the ECS Service
  • Nodejs application is reachable with {LoadBalancerUrl} url that is shown in the Output tab of Cloudformation

AWS CodePipeline Stpes

steps codepipeline

Github WebHook (To trigger aws codepipeline)

webhook

ECS Tasks

ecs tasks

Express.js App

appnodejs