AWS in Plain English

New AWS, Cloud, and DevOps content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Member-only story

AWS CodePipeline for Amazon ECS, Part 2: A Blue/Green Deployment Type

Ivan Polovyi
AWS in Plain English
5 min readJul 25, 2021

--

This is the second part of the tutorial on AWS CodePipeline for ECS. I highly recommend that you read the first part here. In part 2 I focus on how to create the CodePipeline. Here I assume that you already have an ECS cluster, an Elastic Load Balancer with at least one Target Group, an ECR repository with a Docker image, a task definition that uses this image, and an AWS CodeBuild project.

The diagram below shows how the AWS CodePipeline integrates with the AWS ECS with a blue/green deployment type.

Tutorial diagram

1. Source code

The source code for this example you can find here. For CodePipeline to work properly a root directory of a source code of an application has to have 3 files: appspec.yaml, buildspec.yaml and taskdef.json.

The appspec.yaml is very simple and should look like the example below. Just fill up ContainerName and ContainerPort. Both of these configurations you can find in a task definition.

--

--

Published in AWS in Plain English

New AWS, Cloud, and DevOps content every day. Follow to join our 3.5M+ monthly readers.

Written by Ivan Polovyi

I am a Java Developer | OCA Java EE 8 | Spring Professional | AWS CDA | CKA | DCA | Oracle DB CA. I started programming at age 34 and still learning.

Responses (2)