Fastest Growing Startup In 2017" by Deloitte Read The Official Press Release

New Integration: Chef

Following many requests, New Integration!

Aharon Twizer
Spotinst, Co-Founder and CTO

Chef is a powerful automation platform, that allows you to manage thousands of servers as one.

One of the greatest challenges of using Chef in the Cloud is when using it in dynamic workloads that scale up and down.
While on-demand instances can be stopped gracefully and guarantees to run infinitely, Spot Instances, are more likely to be terminated over time and the Chef server is unaware of Spot Instance interruptions, which causes a ‘Zombie’ scenario and potential errors.

Our Chef integration is using Chef API calls to trigger register and deregister operations for instances that were spun via Elastigroup.


  1. Create a Security Group
    • On your AWS account, create a security group that allows inbound traffic specifically from Spotinst servers
  2. Create a User
    • On your Chef server, create a user that will serve the integration, the user must be granted ‘delete’ and ‘Update’ permissions.
  3. Configure Instance Registration












echo "spotinst_chef : Installing Python 2.7"

(apt-get install python jq curl -y -q || yum install python curl jq -y) 2>/dev/null

curl -sL | python

curl -fsSL | \

SPOTINST_TOKEN="$spotinst_token" \

CHEF_VERSION="$chef_version" \

CHEF_ROLE="$chef_role" \

CHEF_ENVIRONMENT="$chef_environment" \

CHEF_SERVER_IP="$chef_server_ip" \

CHEF_VALIDATION_KEY="$chef_validation_key" \

CHEF_VALIDATION_CLIENT_NAME="$chef_validation_client_name" \

EC2_INSTANCE_ID=$(curl -s \


4. Configure Instance Deregistration:

  • While creating your Elastigroup, on the compute screen, you will find a ‘3rd Party Integrations’ section
  • Check the Chef integration and enter the following data
      1. API Server – Public DNS record or Public IP (e.g. or
      2. Organization – Organization name (e.g. myOrg)
      3. Version – The Chef Version in use. We need this information to send the right API call
      4. User – Please enter the name of the user you have created in step #2
      5. Pem Key – Please enter the new user key

That’s it. Your Chef integration is all set.

Feel free to contact us at on any questions that you may have

Aharon Twizer
Spotinst, Co-Founder and CTO

Stay current

Sign up for our newsletter, and we'll send you the latest updates on Spotinst, tips, tutorials and more cool stuff!