This provider uses the Terraform Plugin Framework and can be used locally without building a binary.
Create a Terraform CLI config file at ~/.terraform.d/config.tfrc:
provider_installation {
dev_overrides {
"runpod/runpod" = "/Users/books/repos/terraform-provider"
}
direct {}
}Then in your Terraform configuration:
terraform {
required_providers {
runpod = {
source = "runpod/runpod"
}
}
}
provider "runpod" {
api_key = var.runpod_api_key
}Copy the provider directory to a local mirror location and configure:
provider_installation {
filesystem_mirror {
"runpod/runpod" = ["/path/to/provider/directory"]
}
direct {}
}This repository contains:
-
Generated Provider Code (
internal/provider/)- All resources and data sources generated from
terraform-provider-spec.json - No manual implementation needed for basic schema
- All resources and data sources generated from
-
Example Configurations (
examples/)- Demonstrates how to use each resource and data source
-
Provider Spec (
terraform-provider-spec.json)- Defines all resources, data sources, and their schemas
- Can be modified to add new features
# Initialize Terraform (uses dev_overrides from ~/.terraform.d/config.tfrc)
cd examples/basic
terraform init
# Plan with your API key
terraform plan -var="runpod_api_key=your-key" -var="machine_id=your-machine-id"
# Apply
terraform apply -var="runpod_api_key=your-key" -var="machine_id=your-machine-id"The provider is defined in terraform-provider-spec.json with:
runpod_pod- Pod managementrunpod_pod_action- Pod actionsrunpod_machine- Machine management
runpod_pod- Pod informationrunpod_machine- Machine informationrunpod_machines- Machine listingrunpod_gpu_types- GPU typesrunpod_data_centers- Data centersrunpod_user- User info
If you modify terraform-provider-spec.json:
tfplugingen-framework generate all \
--input terraform-provider-spec.json \
--output internal/providerTo make this truly plug-and-play for others:
- Register at https://registry.terraform.io/
- Create a namespace (e.g.,
runpod) - Set up GitHub integration
- Tag releases with
vX.Y.Zformat - The provider will be available as
runpod/runpod
Once published, users can simply use:
terraform {
required_providers {
runpod = {
source = "runpod/runpod"
version = ">=0.1.0"
}
}
}