/terraform-spotinst-aws-connect

A Terraform module to connect an AWS account to Spot.io.

Primary LanguageHCLApache License 2.0Apache-2.0

Connect AWS Account To Spot.io Terraform Module

Introduction

The module will aid in automatically connecting an AWS Account to Spot via terraform. This will leverage a null_resource calling a python script calling the Spot.io APIs to: create a Spot account within your Spot Organization, create a secure autogenerated externalId and add the ARN of the created IAM role to the Spot platform.

Pre-Reqs

  • Spot.io organization admin API token.
  • Python 3
  • 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"

    spotinst_token = "Redacted"

    #(Optional) Name of the account in Spot platform - If none is provided use AWS account alias as the account name.
    #name = "test-terraform"

    #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 AWS IAM Policy
  • Create new Spot account within current Spot organization
  • Retrieve unique auto-generated External-ID
  • 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.