CodePipeline Stages

Source Stage

Build Stage

For Development and Staging CodePipeline, CodeBuild builds docker image from the
source code and pushes it to ECR.
For production environment, CodeBuild pulls docker image from the
Staging ECR and pushes it to Production ECR.

Also, CodeBuild updates the CloudFormation template (service.yaml) to deploy the ECS
Service with environment specific information.

Deploy Stage

AWS CloudFormation creates/updates the CloudFormation stack to create/update the
application Service in ECS.

Architecture

Cross Account Deployment with Automated Release

The ngp-app-codepipeline can be configured to run staging and production pipeline in different accounts.
Using this workflow, release can be triggered from the Staging pipeline and Production
pipeline with pull the ECR image from Staging AWS Account.