aws / aws-codedeploy-agent

Host Agent for AWS CodeDeploy
https://aws.amazon.com/codedeploy
Apache License 2.0
328 stars 188 forks source link

How do I ensure sequential execution of deployment in deployment configuration? #335

Closed Ruchira-R closed 1 year ago

Ruchira-R commented 1 year ago

I don't see any option to configure - I want to execute in machine 1, mahcine 2 and then on machine 3. How do I specify the order?

mwjones-aws commented 1 year ago

CodeDeploy has no mechanism to enforce the order in which the instances in a deployment group receive deployments. CodeDeploy deployment groups support a deployment configuration called CodeDeployDefault.OneAtATime which will deploy to only 1 host at a time. However, this configuration makes no guarantees about the order in which hosts receive deployments. More information about CodeDeploy deployment configurations can be found here.

Here are two ways you might do an order-aware deployment:

  1. SSM SendCommand API. This approach does not involve CodeDeploy at all
  2. One CodeDeploy DeploymentGroup per host

Bear in mind that CodeDeploy cannot orchestrate either of these approaches for you. You will need to write code, like a Lambda function, to perform the individual deployments.

edited to fix markdown