Manage Puchify infrastructure declaratively with HashiCorp Terraform. 12 resources, 4 data sources, full CRUD, state import, and plan-based workflows.
terraform {
required_providers {
puchify = {
source = "puchify/puchify"
version = "~> 0.1"
}
}
}
variable "puchify_api_key" {
type = string
description = "Puchify API key"
sensitive = true
}
provider "puchify" {
api_key = var.puchify_api_key
}# Create an application server
resource "puchify_server" "app" {
name = "app-server"
plan = "standard-2"
region = "us-east"
image = "ubuntu-24.04"
}
# Create a managed Postgres database
resource "puchify_data" "main" {
name = "main-db"
engine = "postgres"
plan = "starter"
}
# Configure DNS
resource "puchify_domain" "site" {
name = "app.example.com"
}
# Store user uploads
resource "puchify_object_storage_bucket" "assets" {
name = "app-assets"
}
# Distribute traffic
resource "puchify_load_balancer" "api" {
name = "api-lb"
}
# Schedule backups
resource "puchify_backup" "daily" {
resource_id = puchify_server.app.id
schedule = "daily"
retention = 7
}Already have resources created through the dashboard, CLI, or API? Import them into Terraform state without recreating.
terraform import puchify_server.app server_abc123 terraform import puchify_data.main db_xyz789 terraform import puchify_domain.site domain_example_com
data "puchify_regions" "all" {}
output "regions" {
value = data.puchify_regions.all.items
}data "puchify_plans" "small" {
min_vcpus = 2
}data "puchify_servers" "all" {}puchify_serverVirtual servers — CRUD, restart, destroy.
puchify_gpu_serverGPU-accelerated servers
puchify_dataManaged databases (Postgres, MySQL, Redis, Valkey)
puchify_kubernetes_clusterManaged Kubernetes clusters
puchify_object_storage_bucketS3-compatible object storage buckets
puchify_file_storage_shareNFS-backed file shares
puchify_load_balancerHTTP/TCP load balancers
puchify_vpn_gatewaySite-to-site VPN gateways
puchify_nat_gatewayOutbound internet NAT
puchify_domainDNS management with TLS
puchify_backupBackup and restore service
puchify_webhookEvent-driven webhook subscriptions