The Pulumi RunPod provider lets you manage RunPod GPU cloud infrastructure using infrastructure as code.
| Resource | Description |
|---|---|
runpod:Template |
Container templates for pods and serverless endpoints |
runpod:Pod |
GPU and CPU pod instances |
runpod:Endpoint |
Serverless GPU endpoints |
runpod:NetworkVolume |
Persistent network-attached storage volumes |
runpod:Secret |
Encrypted secrets for use in pods and endpoints |
runpod:ContainerRegistryAuth |
Container registry authentication credentials |
| Function | Description |
|---|---|
runpod:getGpuTypes |
List available GPU types with pricing and availability |
runpod:getCPUFlavors |
List available CPU configurations |
runpod:getDataCenters |
List data centers with GPU availability |
The provider plugin is installed automatically when you use it in a Pulumi program.
npm install @runpod/pulumipip install pulumi_runpodgo get github.com/runpod/pulumi-runpod/sdk/go/runpoddotnet add package Pulumi.RunpodSet your RunPod API key:
pulumi config set runpod:apiKey --secret YOUR_API_KEYOr use the RUNPOD_API_KEY environment variable.
Optionally set a custom API URL (defaults to https://api.runpod.io/graphql):
pulumi config set runpod:apiUrl https://api.runpod.io/graphqlimport * as runpod from "@runpod/pulumi";
const template = new runpod.Template("myTemplate", {
name: "my-template",
imageName: "runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04",
containerDiskInGb: 20,
volumeInGb: 20,
startSsh: true,
});
const endpoint = new runpod.Endpoint("myEndpoint", {
name: "my-endpoint",
templateId: template.templateId,
gpuIds: "AMPERE_16",
workersMin: 0,
workersMax: 3,
idleTimeout: 5,
});
export const endpointId = endpoint.endpointId;import pulumi
import pulumi_runpod as runpod
template = runpod.Template("myTemplate",
name="my-template",
image_name="runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04",
container_disk_in_gb=20,
volume_in_gb=20,
start_ssh=True,
)
endpoint = runpod.Endpoint("myEndpoint",
name="my-endpoint",
template_id=template.template_id,
gpu_ids="AMPERE_16",
workers_min=0,
workers_max=3,
idle_timeout=5,
)
pulumi.export("endpointId", endpoint.endpoint_id)package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
runpod "github.com/runpod/pulumi-runpod/sdk/go/runpod"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
template, err := runpod.NewTemplate(ctx, "myTemplate", &runpod.TemplateArgs{
Name: pulumi.String("my-template"),
ImageName: pulumi.String("runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04"),
ContainerDiskInGb: pulumi.Int(20),
VolumeInGb: pulumi.Int(20),
StartSsh: pulumi.Bool(true),
})
if err != nil {
return err
}
ctx.Export("templateId", template.TemplateId)
return nil
})
}name: runpod-example
runtime: yaml
# Set runpod:apiKey via: pulumi config set runpod:apiKey --secret YOUR_KEY
# Or use the RUNPOD_API_KEY environment variable.
resources:
myTemplate:
type: runpod:Template
properties:
name: my-template
imageName: runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04
containerDiskInGb: 20
volumeInGb: 20
startSsh: true
myEndpoint:
type: runpod:Endpoint
properties:
name: my-endpoint
templateId: ${myTemplate.templateId}
gpuIds: AMPERE_16
workersMin: 0
workersMax: 3
idleTimeout: 5
outputs:
endpointId: ${myEndpoint.endpointId}make build installmake test_providerApache 2.0. See LICENSE.