3

This is my case.

  • one instance with three application [ 4000, 4001, 4002 ].

  • Created an ALB and redirected 3 domains to three target groups using rules

  • When I use to create an application in Code-deploy [Blue-green], it asks for only one target group at a time. But I have three target groups associated with the autoscaling group.

  • After Deployment it is not registering instances with other two target groups. I tried Creating Different ALB, i.e., three ALB with three target groups. But I end up in code deploy sending traffic to one target group.

I am deploying code directly from bitbucket. I need code to deploy [Blue-green] to register instance automatically with all three target groups. But as per AWS CodeDeploy documentation, only one target group can be selected at the time of code deploy. Any kind of help is much appreciated.

Reza Mousavi
  • 4,420
  • 5
  • 31
  • 48
gotam
  • 193
  • 2
  • 11

1 Answers1

2

At the moment, CodeDeploy does not support configuring multiple target groups in a single deployment. There are workarounds, but they're not awesome.

1. Break out each application into its own deployment group and deployment individually

You could deploy each application separately in a different deployment group, which would allow you to register/deregister to each target group. However, this approach would not work with blue/green deployments.

2. Register/deregister 2 target groups in your user scripts

You could configure your appspec to register and deregister from 2 targets groups using a script. There is a sample script on Github, though it's not not recommended for production use.

3. Break out your application into 3 sets of instances

Right now, you're running 3 different applications on the same hosts. You probably have good reason to do that, but if you could break out the applications into 3 different sets of hosts, you could break them into 3 different deployment groups and still use blue/green deployments.

EmptyArsenal
  • 7,314
  • 4
  • 33
  • 56
  • 1
    yes sorted out already . i configured aws configs in image . so it can register/deregister with TG and used appspec.yml to do it . Anyway thanks for the answer – gotam Dec 29 '18 at 08:11
  • @gotam what do you mean by "i configured aws configs in image"? you used scripting? something else? – Michael Davidson Mar 27 '19 at 18:57