Skip to content

spotinst/terraform-spotinst-aws-connect

Repository files navigation

Connect AWS Account To Spot.io Terraform Module

Introduction

The module will aid in automatically connecting an AWS Account to Spot via terraform.

Pre-Reqs

  • Spot.io organization admin API token.
  • The Terraform CLI, version 0.14 or later.
  • AWS Credentials configured for use with Terraform.

Example

module "spotinst-aws-connect" {
    source = "spotinst/aws-connect/spotinst"
    
    #Name for the Spot account. The account name must contain at least one character that is a-z or A-Z

    name = "your-account-name"
    spotinst_token = "Redacted"

    #Policy File (Optional) File with policy to attach to the Spot role
    #policy_file = templatefile(minimal-spot-iam-policy.json.tftpl", {
    #   region     = "us-east-1"
    #   account_id = "123456789" })
}

Run

This Terraform module will do the following:

On Apply:

  • Create new Spot account within current Spot organization
  • Retrieve unique External-ID returned by spot API
  • Create AWS IAM Policy
  • Create AWS IAM Role with trust relationship
  • Assign policy to IAM Role
  • Provide IAM Role to newly created Spot Account

On Destroy:

  • Remove all above resources including deleting the Spot account from the Spot platform

Documentation

If you're new to Spot and want to get started, please checkout our Getting Started guide, available on the Spot Documentation website.

Getting Help

We use GitHub issues for tracking bugs and feature requests. Please use these community resources for getting help:

Community

Contributing

Please see the contribution guidelines.