Terraform and OpenTofu on Quake AI
Coming from another cloud?
▸AWS·Stacks
Stacks
- Quake AI offers Heat (legacy OpenStack orchestration) and recommends OpenTofu for new IaC work; EKS uses declarative console/CLI.
- EKS Auto Mode automates data plane; Quake AI uses OpenTofu modules for infrastructure provisioning.
- CloudFormation stacks are managed via AWS-specific REST API (e.g., cloudformation.us-east-1.amazonaws.com) requiring AWS SigV4 auth, while Heat (legacy) uses OpenStack Identity API v3 (keystoneauth) and OpenTofu uses the OpenStack provider with application credentials. Migrators notice different endpoint discovery and auth flows.
- Stacks support StackSets for cross-region/account deployment; Heat has no equivalent. OpenTofu workspaces offer a different multi-environment pattern.
▸Azure·Resource Manager deployment (deployment)
Azure Resource Manager deployment (deployment)
- Authoring format differs: ARM templates are JSON documents for Azure Resource Manager deployments, whereas Quake AI offers Heat (legacy, HOT/YAML format) and recommends OpenTofu (HCL) for new infrastructure automation.
- Deployment target/scope differs: ARM templates can deploy at multiple scopes (resource group, subscription, management group, tenant) via Azure Resource Manager's management layer, while Heat orchestrates within a single OpenStack project/tenant. OpenTofu can target multiple projects via provider configuration.
- Change-preview behavior differs: ARM supports a built-in “what-if” style preview of changes via Resource Manager deployments, while OpenTofu provides `tofu plan` for change previews. Heat relies on stack update events (legacy workflow).
- Resource coverage lifecycle differs: ARM templates support Azure resource types exposed by Azure resource providers; OpenTofu covers OpenStack resource types via the OpenStack provider, and Heat (legacy) supports a narrower set via built-in resource plugins.
▸Google Cloud·Deployment Manager
Deployment Manager
- Uses YAML configurations with optional Jinja2/Python templates expanded server-side; Quake AI offers Heat (legacy, HOT/YAML) and recommends OpenTofu (HCL) for new work.
- Resource types named as service.v1.resource (e.g., compute.v1.instance) tied to GCP APIs, vs OpenStack prefixed types like OS::Nova::Server.
- Single integrated GCP service (no separate API/engine processes); Heat has a multi-service architecture (heat-api, heat-engine) but is legacy. OpenTofu runs client-side with no server component.
- No additional service fee; bills only for deployed GCP resources, same as OpenStack resources billing via provider.
Terraform and OpenTofu on Quake AI
Terraform and OpenTofu use HashiCorp Configuration Language (HCL) to define infrastructure as code. You describe the resources you want (instances, networks, volumes, security groups) in .tf files, and the tool creates, updates, or destroys them to match your declared state. Both tools use the same OpenStack provider and produce identical results on Quake AI.
For a comparison of OpenTofu and Terraform, see IaC on Quake AI. This page focuses on how Terraform and OpenTofu work with Quake AI specifically: provider configuration, authentication, state management, and the resource types available.
The OpenStack provider#
Terraform and OpenTofu interact with Quake AI through the OpenStack provider. The provider translates HCL resource definitions into OpenStack API calls.
Declare the provider in your main.tf:
terraform {
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 2.0"
}
}
}
provider "openstack" {}The empty provider "openstack" {} block tells the provider to read credentials from environment variables, which is the recommended approach.
Authentication#
The provider supports two authentication methods. Both use application credentials generated in the Quake AI console.
Environment variables (recommended)#
Source your application credential file before running any Terraform command:
source ~/openrc.sh
terraform planThe provider reads OS_AUTH_URL, OS_APPLICATION_CREDENTIAL_ID, and OS_APPLICATION_CREDENTIAL_SECRET from the environment. This keeps credentials out of your .tf files and version control.
Explicit provider configuration#
For CI/CD pipelines or environments where sourcing a file is impractical, pass credentials directly:
provider "openstack" {
auth_url = "https://keystone.rumble.cloud/v3"
application_credential_id = var.credential_id
application_credential_secret = var.credential_secret
}Use Terraform variables or a secrets manager to inject the values; never hardcode credentials in .tf files.
State management#
Terraform tracks the real-world state of your infrastructure in a state file (terraform.tfstate). This file maps each HCL resource to the corresponding OpenStack resource ID, enabling Terraform to detect drift and plan changes accurately.
Local state (default)#
By default, the state file lives in the working directory. This works for personal projects but breaks down when multiple people or CI pipelines manage the same infrastructure.
Remote state on Quake AI#
Store state in Quake AI object storage for team access and state locking:
terraform {
backend "s3" {
bucket = "terraform-state"
key = "production/terraform.tfstate"
endpoint = "https://object.us-east-1.rumble.cloud" # replace with your region
region = "us-east-1" # us-east-1 | us-east-2 | us-west-1
skip_credentials_validation = true
skip_metadata_api_check = true
skip_region_validation = true
force_path_style = true
}
}Generate S3 credentials through the console (see Create S3 credentials) and export them as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY before running terraform init.
Common resource types#
The OpenStack provider maps Quake AI services to Terraform resource types. These are the resources you use most frequently:
Compute#
| Resource | Purpose |
|---|---|
openstack_compute_instance_v2 | Create and manage virtual machine instances |
openstack_compute_keypair_v2 | Import SSH public keys for instance access |
openstack_compute_servergroup_v2 | Define affinity and anti-affinity placement policies |
openstack_images_image_v2 (data source) | Look up available OS images by name |
openstack_compute_flavor_v2 (data source) | Look up instance sizes by name |
Network#
| Resource | Purpose |
|---|---|
openstack_networking_network_v2 | Create private networks |
openstack_networking_subnet_v2 | Define subnets with CIDR ranges and DNS |
openstack_networking_router_v2 | Create routers for internet and inter-network routing |
openstack_networking_router_interface_v2 | Connect subnets to routers |
openstack_networking_floatingip_v2 | Allocate public IP addresses |
openstack_networking_secgroup_v2 | Create security groups |
openstack_networking_secgroup_rule_v2 | Define firewall rules |
openstack_networking_port_v2 | Create network ports with fixed IPs |
Storage#
| Resource | Purpose |
|---|---|
openstack_blockstorage_volume_v3 | Create block storage volumes |
openstack_compute_volume_attach_v2 | Attach volumes to instances |
Public application entry points#
| Resource | Purpose |
|---|---|
openstack_networking_port_v2 | Create a dedicated port for an edge proxy or API gateway instance |
openstack_networking_floatingip_v2 | Allocate a stable public address for the edge instance |
openstack_networking_floatingip_associate_v2 | Associate the public address with the edge instance port |
openstack_networking_secgroup_rule_v2 | Allow HTTP, HTTPS, and restricted administration traffic |
Automation (legacy Heat)#
| Resource | Purpose |
|---|---|
openstack_orchestration_stack_v1 | Manage existing Heat stacks from OpenTofu |
The plan/apply workflow#
Each infrastructure change follows the same cycle:
terraform init: download the OpenStack provider plugin and configure the backend. Run once per project or when you change providers.terraform plan: compare the declared state in your.tffiles against the real state interraform.tfstate. Terraform prints a diff showing what it creates, modifies, or destroys.terraform apply: execute the planned changes. Terraform prompts for confirmation before making any API calls.terraform destroy: tear down all resources managed by the current configuration. Use this to clean up test environments.
Review the plan output before applying. Terraform distinguishes between in-place updates (modifying a resource's attributes) and replacements (destroying and recreating a resource). Replacements can cause downtime; look for forces replacement in the plan output.
Project structure#
A typical Quake AI Terraform project splits configuration across files by concern:
.
├── main.tf # Provider configuration
├── variables.tf # Input variables
├── data.tf # Data sources (images, networks, flavors)
├── compute.tf # Instance definitions
├── network.tf # Networks, subnets, routers, security groups
├── storage.tf # Volumes and attachments
├── outputs.tf # Output values (IPs, IDs)
└── terraform.tfvars # Variable values (not committed to version control)Terraform loads all .tf files in the working directory automatically; the file names are for human organization, not tool requirements.
Operational best practices#
Pin the provider version. Use version = "~> 2.0" to allow patch updates while preventing breaking changes. Run terraform init -upgrade when you want to pick up a new minor version.
Use variables for everything that changes between environments. Instance counts, flavors, network CIDRs, and image names should be variables. Hardcoded values create drift between staging and production.
Use terraform.tfvars for environment-specific values. Keep one .tfvars file per environment and pass it with terraform plan -var-file=production.tfvars.
Never commit terraform.tfstate or .tfvars files. The state file contains resource IDs and may contain sensitive attributes. The .tfvars file may contain credentials. Add both to .gitignore.
Use anti-affinity server groups. When deploying multiple instances of the same role, place them in a soft-anti-affinity server group. This distributes instances across physical hosts for fault tolerance.
Tag resources consistently. Use the tags attribute on networks, ports, and other resources that support it. Tags make it possible to identify Terraform-managed resources in the console and CLI.
Further reading#
On this platform:
- IaC on Quake AI: comparison of OpenTofu and Terraform
- How to create application credentials: generate the credentials Terraform needs
- Simple VM Terraform example: minimal working configuration
- Full-stack Terraform example: multi-tier infrastructure with a self-managed edge proxy
- Validated IaC templates in the template library
- Terraform error handling: diagnose common Terraform failures
External resources:
- OpenStack Terraform provider documentation: full resource and data source reference
- Terraform documentation: language reference, CLI commands, state management
- OpenTofu documentation: open-source fork with identical syntax and provider support
Related content
Pages
How-tos
How to add a block volume to a template
Automation
How to customize a template's image and flavor
Automation
How to debug Terraform errors
Automation
How to deploy a multi-tier application with Terraform
Automation
How to deploy an application to a Quake AI VM from CI
Automation
How to deploy VMs with Terraform (simple example)
Automation
How to emulate a branchable Postgres workflow
Automation
How to integrate OpenTofu with CI/CD
Automation
How to launch a Windows Server VM
Compute
How to manage multiple environments with OpenTofu
Automation
How to manage OpenTofu state with Quake AI S3
Automation
How to parameterize a template with a tfvars file
Automation
How to restore PostgreSQL from a self-managed-postgres backup
Automation
Tutorials
Explanations
Overviews
migration
How to migrate from AWS CloudFormation to OpenTofu on Quake AI
Automation
How to migrate from Docker Compose to OpenTofu on Quake AI
Automation
How to migrate from Hetzner Cloud to Quake AI with OpenTofu
Automation
How to migrate from Linode (Akamai) to Quake AI with OpenTofu
Automation
How to migrate from Vultr to Quake AI with OpenTofu
Automation
Migrate a Docker container app from AWS to Quake AI
Compute
Migration Guides
Automation
deployment
Deploy a private container registry with OpenTofu
Automation
Deploy a self-hosted git forge and CI with OpenTofu
Automation
Deploy an inference gateway with OpenTofu
Automation
Deploy the audio post-production worker template with OpenTofu
Automation
Deploy the CPU render-farm worker pool template with OpenTofu
Automation
Deploy the Creator-AI inference worker template with OpenTofu
Automation
Deploy the development environment template with OpenTofu
Automation
Deploy the full-stack application template with OpenTofu
Automation
Deploy the Kubernetes cluster bootstrap template with OpenTofu
Automation
Deploy the live RTMP/SRT ingest and restream template with OpenTofu
Automation
Deploy the monitoring stack template with OpenTofu
Automation
Deploy the MySQL/MariaDB database template with OpenTofu
Automation
Deploy the private network + VPN template with OpenTofu
Automation
Deploy the S3 Storage with ACLs template with OpenTofu
Automation
Deploy the self-managed PostgreSQL template with OpenTofu
Automation
Deploy the Simple VM template with OpenTofu
Automation
Deploy the three-tier application template with OpenTofu
Automation
Deploy the WordPress + MySQL template with OpenTofu
Automation