Skip to content

spotinst/terraform-spotinst-azure-connect-v2

Repository files navigation

Connect Azure Subscription To Spot.io Terraform Module

Introduction

A Terraform module to connect an Azure Subscription to Spot.io

Details

The module will aid in automatically connecting your Azure Subscription to Spot via terraform. Permissions will be managed by Azure Active Directory with a custom role that will be assigned to the Application. The Terraform module will leverage Spot APIs called via a script to complete the connection to the Spot platform.

Example

# One or more subscriptions can be added.
provider "azurerm" {
  subscription_id = "redacted"
  features {}
}
provider "azuread" {
  tenant_id = "redacted"
}
provider "spotinst" {
  token   = "redacted"
}
#Call the spot module to create a Spot account and link to the first Azure subscription
module "azure-connect" {
  source          = "spotinst/azure-connect-v2/spotinst"
  spotinst_account_name = "spot-account-azure"
}

output "spot_account_id" {
  value = module.azure-connect.spot_account_id
}

Pre-Reqs

  • Spot Organization Admin API token.
  • Subscription ID/s
  • Azure Active Directory ID
  • Azure CLI access with permissions to perform the following actions on each subscription:
    • For Apply:
      • Microsoft.Authorization/roleDefinitions/write
      • Microsoft.Authorization/roleAssignments/write
    • For Destroy:
      • Microsoft.Authorization/roleDefinitions/delete
      • Microsoft.Authorization/roleAssignments/delete

Apply

The terraform module will do the following:

On Apply:

  • Create New Spot Account.
  • Create an App Registration
  • Create an App Secret
  • Create a Custom Role
  • Create a Service Principal
  • Assign Role to Application on Subscription
  • Provide and link newly created application credentials to Spot account.

On Destroy:

  • Remove all above resources including deleting the Spot Account.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •