Skip to content

shadeform/terraform-provider-shadeform

Repository files navigation

Terraform Provider for Shadeform

Terraform Registry License: MIT

A Terraform provider for managing GPU instances and storage volumes on Shadeform, a unified platform for deploying and managing cloud GPUs across multiple cloud providers. For more information about what Shadeform is and how to use it, visit our public docs.

Quick Start

Installation

Add the provider to your Terraform configuration:

terraform {
  required_providers {
    shadeform = {
      source  = "shadeform/shadeform"
      version = "~> 0.1.0"
    }
  }
}

Configuration

Configure the provider with your Shadeform API key:

provider "shadeform" {
  api_key = "YOUR_API_KEY"
}

You can also set the API key via environment variable:

export SHADEFORM_API_KEY="YOUR_API_KEY"

If you do that, make sure to set the api_key to ""

Commands

# Initialize Terraform
terraform init

# Plan the changes
terraform plan

# Apply the changes
terraform apply

# Check the state
terraform show

# Destroy the resources
terraform destroy

Basic Usage

Create a GPU instance:

resource "shadeform_instance" "test-instance" {
  cloud              = "scaleway"
  region             = "paris-france-1"
  shade_instance_type = "H100"
  name               = "terraform-test-instance"
} 

Create a persistent storage volume:

resource "shadeform_volume" "test-volume" {
  cloud      = "datacrunch"
  region     = "helsinki-finland-2"
  name       = "terraform-test-volume"
  size_in_gb = 101
}

NOTE: Instances can take anywhere from 1 - 15 minutes on average to spin up with some evening taking upwards of 30-40 minutes. The terraform apply command won't finish until the instances are active (or errored out). There is a default timeout of 60 minutes.

Requirements

Name Version
terraform >= 1.0
go >= 1.21

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Changelog

See CHANGELOG.md for a list of changes and version history.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages