Deploy an ECS application with Blue/Green deployment, using Terraform, CodePipeline, CodeBild, CodeCommit, and CodeDeploy
- Create a codecommit repo
- Create a Elastic Container Registry and use the Dockerfile given at repo to create an image and push in to the registry.This image will be used to initially deploy our ECS service
- Create a file named buildspec.yml in our codecommit repo with the content
- Create a file named appspec.yml in our codecommit repo with the content
- Execute the terraform code to create the infrastructure
- Go to ECS console and copy the task definition json and place it in the codecommit repo as taskdef.json. Make sure to change
` “image”: “808658323399.dkr.ecr.us-east-1.amazonaws.com/springbootapp”
to
“image”: <IMAGE1_NAME> `
- Start Codepipeline by pushin updated code to codecommit
- CodeDeploy started shifting traffic