Using Octopus Deploy AWS Auto-Scaling Groups

There are few items to consider when using auto-scaling groups with Octopus Deploy.

  1. Machine registration. Tentacles can be installed and registered from the command line.

  2. Deployment target triggers. When a new machine is registered you will want to deploy to it. You can leverage machine target triggers to accomplish that.

  3. Skipping steps. When you are automatically scaling out chances are you will not want to run specific steps in your deployment process. For examples, in this process, we only want to run step 4 when a new web server is added.

Using run conditions ( will allow you to skip a step. To stop that from happening, this run condition: #{unless Octopus.Deployment.Trigger.Name}True#{/unless} will work. It is a bit of a double negative. If the deployment was triggered manually by a person, or through a service account by a build server, the step will run. If it is triggered by a trigger the step will be skipped.

  1. Scaling down. With AWS you will get a two minute warning when a machine is going to be removed. Not enough time to manually remove the machine from Octopus. However, you can run an AWS Lambda function. That Lambda function can invoke the Octopus API to remove the machine. Here is an example script written in PowerShell, but should give you an idea.