This directory contains examples demonstrating how to use the RunPod Terraform Provider.
- Terraform >= 1.0
- RunPod API key (set via
RUNPOD_API_KEYenvironment variable or in provider config)
Simple GPU pod creation example with basic configuration including:
- GPU type and data center selection
- Environment variables
- Port exposure
- Storage configuration
Comprehensive example demonstrating:
- Pod creation with network volume attachment
- Regional constraints for network volumes
- Data sources for listing resources
- Multiple outputs for monitoring
-
Set your API key:
export RUNPOD_API_KEY="your-api-key-here"
-
Choose an example and navigate to its directory:
cd basic-pod -
Run Terraform:
terraform plan terraform apply
-
Clean up when done:
terraform destroy
- These examples use community cloud instances for cost-effectiveness
- GPU availability varies by region and type
- Network volumes must be in the same region as pods when attached
- State files (
.tfstate) and variable files (.tfvars) are gitignored