

How to use Spot & Terraform
In this post, we will explain how to create a cost-efficient Auto-Scaling in AWS using the Spot plugin for Terraform (listed in the Terraform registry as the Spotinst provider).
Step One: Install Terraform
Get the latest Terraform build, and make sure you have the Spotinst provider installed there.
Step Two: Connect Spot as a Provider
provider "spotinst" { token = "spotinst-token" #generate in the Spot Console / API account = "act-123abcd" #your Spot account ID (starts with act-) } resource "spotinst_elastigroup_aws" "spot-elastigroup-tf-provider-v2" { # Group Parameters # Full list of parameters here ; https://help.spot.io/integration-docs/elastigroup/provisioning-tools/terraform/resources/terraform-v-2/elastigroup/ }
[alert type=”info”]For more detailed info about each property – please use the documentation. [/alert]
Once you have everything setup correctly, you can execute your Terraform file and apply the changes. It should trigger an API call to Spot and create an Elastigroup.