Skip to content

Instantly share code, notes, and snippets.

@displague
Last active February 18, 2021 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save displague/8e427f6e5e7904b346fa15b95af98aa7 to your computer and use it in GitHub Desktop.
Save displague/8e427f6e5e7904b346fa15b95af98aa7 to your computer and use it in GitHub Desktop.
Using Equinix Metal's Terraform provider with Terraform v0.12

In Terraform 0.13, providers are fetched from the Terraform registry. More details here.

The Packet provider was included in the Hashicorp registry, used prior to TF 0.13 and can be access with legacy syntax. The Equinix Metal provider was not released until after that transition.

It is possible to use the Equinix Metal provider with Terraform 0.12 with a few additional steps:

  1. Download the provider for your architecture from https://github.com/equinix/terraform-provider-metal/releases
  2. Extract the provider and copy the binary into terraform.d/plugins/$ARCH (darwin_adm64, for example)
  3. Include a terraform stanza and configure the provider resource with an auth_token
    # main.tf (example)
    terraform {
     required_providers {
       metal = "~> 1.0"
     }
    }
    
    variable "token" {}
    
    provider "metal" {
     auth_token = var.token
    }
    
    data "metal_operating_system" "example" {
     distro  = "ubuntu"
     version = "18.04"
    }
  4. terraform init
  5. terraform apply

See https://www.terraform.io/docs/extend/how-terraform-works.html#selecting-plugins for more details on using plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment