Skip to content

metal-stack-cloud/terraform-provider-metal

Repository files navigation

Terraform Provider for metalstack.cloud

Manage the lifecycle of your bare-metal Kubernetes clusters on metalstack.cloud using Terraform.

Note: this project is in an early development stage. It might break in the future and getting started might be cumbersome.

Requirements

Building the provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
go install

Using the provider

First, let's add the provider to your project:

terraform {
  required_providers {
    metal = {
      source = "metal-stack-cloud/metal"
    }
  }
}

To obtain an api token for creating resources, visit metalstack.cloud. Head to the the Access Tokens section and create a new one with the desired permissions, name and validity. Note: Watch out to first select the desired organization and project you want the token to be valid for.

Configure the provider by providing your token:

provider "metal" {
    api_token = "<YOUR_TOKEN>" # or set env METAL_STACK_CLOUD_API_TOKEN

    # project will be derived from the api_token
}

Now you are ready to go!