The Runpod Terraform provider support is currently in beta. Join our Discord to provide feedback and get support.
terraform apply, and track state like any other Terraform-managed resource.
Prerequisites
- Terraform 1.0 or higher
- A Runpod API key
Install and configure
Add the provider to your configuration
Create amain.tf file and declare the Runpod provider:
Set your API key
The recommended approach is to pass your API key as an environment variable so it stays out of your configuration files:Initialize and apply
Quick example: create a pod
This example creates a GPU pod running Miniconda with SSH enabled:Resources
runpod_pod
Creates and manages a Runpod pod.
Attributes (read-only)
runpod_pod_action
Performs an action on an existing pod. Use this to stop, resume, terminate, or reset a pod without destroying and recreating it.
Attributes (read-only)
runpod_template
Creates and manages a reusable pod template. Templates let you define a standard configuration (image, environment variables, disk, ports) once and reuse it across multiple pods or endpoints.
Attributes (read-only)
runpod_endpoint
Creates and manages a serverless endpoint. Endpoints auto-scale workers based on demand.
Attributes (read-only)
runpod_machine
Manages a machine listing. Primarily used by host providers to list machines and set pricing.
Attributes (read-only)