I have a custom AMI that contains the dependencies for several applications.

The only difference between the applications is several configuration options that can be configured by a bash script. (i.e. enabling/disabling certain supervisor groups.)

Each different app is triggered by an different autoscale instance.

How do I get the instance to run a different script on boot by an autoscaler?

1 Answer 1


If I am understanding you correctly, you have one AMI used in several autoscaling groups and want to run a specific “bootstrap” sequence on it depending on the autoscaling group it belongs to.

This is not difficult to accomplish because the launch configuration you created to map the autoscaling group to the AMI can accomodate user data which can be a shell script.

In the shell script provided as user data, it is customary to retrieve meta data so that the instances can correctly identify itself in logs and arrange other similar last minute details. This meta-data could also contain a reference to the auto-scaling group, which you could take advantage of to reduce the little overhead due to autoscaling-group management.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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