1

We are using ECS Fargate containers to deploy all of our services (~10) and want to follow Blue/Green Deployment.

We have deployed all the services under BLUE flag where target groups are pointing to the services.
In CICD, New Target groups are created and having slightly different forward rules to allow testing without any issue.
Now, my System is running with 2 kind of target groups, services and task definition -

  • tg_blue, service_blue, task_blue → pointing to old containers and serving live traffic
  • tg_green, service_green, task_green → pointing to new containers and do not have any traffic.
    All above steps are done in Terraform.

Now, I want to switch the traffic and here I am stuck, How to Switch the Traffic and How the next Deployment will look like?

Atul Singh
  • 59
  • 1
  • 9
  • Are you using CodeDeploy for that? – Marcin Aug 03 '21 at 20:24
  • No, I am not. I was thinking about using the Terraform to do some magic but seems like that is not possible here. I have to explore the CodeDeploy logic, my worry is - there are going to be multiple ECS cluster and we want to use the same Pipeline to do the deployment. Need to check if that is possible with CodeDeploy or not? – Atul Singh Aug 04 '21 at 13:40
  • @AtulSingh Were you able to accomplish the same with terraform? I am also in the same situation. I tried with code-deploy and that can work but it need extra infra just for Code Deployment (Like Code-deploy, Lambda for testing etc). – Jha Sep 08 '22 at 17:14

1 Answers1

1

I would go for AWS native solution if no important reasons against. I have on my mind CodeDeploy. It switches in automatic way between TGroups. Without CDeploy, you need to implement weighted balancing among two TGroups and adjust them later on. That is extra work. Whole flow is quite good explained on this YT video.

irvis
  • 136
  • 1
  • 6