Elastigroup Integrates With AWS CodeDeploy

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.User Data Startup Script

Use the following User Data startup script in the group configuration. For more information please see: User Data

#!/bin/bash -x
REGION=$(curl 169.254.169.254/latest/meta-data/placement/availability-zone/ | sed 's/[a-z]$//')
yum update -y
yum install ruby wget -y
cd /home/ec2-user
wget https://aws-codedeploy-$REGION.s3.amazonaws.com/latest/install
chmod +x ./install
./install auto

2. Register to Integrations

Scroll down the Compute tab and expand the Integrations section.

Enable CodeDeploy integration and select your application and Deployment group resources.

Note: the application and Deployment group resources should already exist in your AWS account.

image2

Where:

  • CleanupOnFailure – if this option is checked, we delete the temporary group created. If not, we don’t delete the temporary deployment group in case of failure (so the user can view the logs of the group and the deployment).
  • Terminate Instance On Failure – if this option is checked, we terminate the instance that failed. If not, we keep the instances that failed.

That’s it, you are ready to go!