Elastigroup Integrates With AWS CodeDeploy

Aharon Twizer

AWS CodeDeploy is a service that automates code deployments to any instance, including Amazon EC2 instances and instances running on-premises. AWS CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during application deployment, and handles the complexity of updating your applications.

Spotinst Elastigroup makes AWS CodeDeploy even more powerful! Save 90% of the infrastructure costs and increase performance.

In order to get Spotinst Elastigroup and AWS CodeDeploy integrated, please follow these steps.

  1. Create The Following IAM Role

    Associate the Elastigroup with your CodeDeploy IAM Instance Role. The Instance Role should have the following policy:

        "Version": "2012-10-17",
        "Statement": [
                            "Resource": "*",
                            "Action": [
                            "Effect": "Allow"


  2. User Data Startup Script

    #!/usr/bin/env bash
    curl -fsSL https://s3.amazonaws.com/spotinst-labs/aws-codedeploy/spotinst_aws_codedeploy.sh | \
    CODEDEPLOY_APPLICATION="myApplication" \


    Note: Before using this user-data shell script, please set the following parameters:


  • Pingback: AWS Week in Review – February 8, 2016 | wart1949()

  • Pingback: AWS Week in Review – February 8, 2016 – SMACBUZZ()

  • Probably there is no need in this – “yum update -y aws-cfn-bootstrap”.

    Article title is wrong (Elatigroup).

  • Spotinst

    Hello Anton,

    Thanks for your feedback!

    The aws-cfn-bootstrap is indeed not required.
    The blog title has been updated, and we also added an alternative way of getting the region from the instance meta-data service.

  • Pedro Vilaça


    I understand that you need that CodeDeploy is configured to use Tags instead of the ASG, because probably spotinst will create multiple ASG (I’m just guessing.. don’t know exactly what you do under the hood), but by doing that, we’re losing the ASG integration of CodeDeploy, that listens to ASG events and trigger a new deployment if an instance is added. Right?

    • Spotinst

      Hi Pedro,

      You won’t lose anything. Spotinst will do it for you out of the box without any life-cycle hooks. Our platform automatically starts a new deployment for every new instance that is added to your Elastigroup.