I have two deployment groups for the same set of EC2 instances: one is an in-place deploy (eg. for "hot" fixes of minor significance), and the other is a blue/green deploy (eg. for bigger changes where I want surety that the app I'm running will properly run on newly-provisioned instances).

This is working well, but I have one issue: if my autoscaling group (used in the blue/green deployment group) needs to create a new instance, the new EC2 server will be provisioned with the deployment ID that the ASG is tagged with in its CodeDeployProvisioningDeploymentId tag. This tag is only updated when I make a blue/green deployment. Because these deployments happen less frequently, this means new instances I create are often several deploys old when they're created.

What I think I need to do is find a way to update the value of the CodeDeployProvisioningDeploymentId tag on my ASG when I deploy a change using the in-place deployment group, so it's always current. Or alternatively, in my provision script which runs on all new instances (to install dependencies etc), I could fetch the latest deployment ID and install it on the instance there and then.

Does anyone have any advice or pro tips on which way to go with this?

1 Answer 1


Updating the tag on your ASG seems the better way to go about this out of your two options, since the subsequent lifecyle event during the provision will still try to deploy the outdated version of your application, thus overriding it.

But why not having a single deployment group that default to in-place deployment, but to which you can create a blue green deployment when needed for those major changes? That gets rid of the need to update the CodeDeployProvisioningDeploymentId tag.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.