Get started with Infrastructure as Code on Quake AI
Get started with infrastructure as code on Quake AI
This guide walks you through installing OpenTofu, authenticating to Quake AI, and deploying your first resource. By the end, you will have a running compute instance created entirely from code.
Prerequisites#
- Quickstart completed (account, project, SSH key, and app credentials)
- A terminal with SSH access
Install OpenTofu#
OpenTofu is the recommended IaC tool for Quake AI. It is a fully open-source fork of Terraform that uses the same HCL configuration language and provider ecosystem.
brew install opentofuVerify the installation:
tofu --versionYou should see an OpenTofu version starting with v1..
Configure authentication#
OpenTofu authenticates to Quake AI through environment variables. This avoids storing credentials in configuration files. The OpenStack provider reads the standard OS_* env vars directly.
Follow Generate app credentials to create and download your credentials file.
Source the file to load credentials into your shell session:
source ~/path/to/openrc.shCreate your first configuration#
Create a new directory for your project and a file called main.tf:
mkdir my-first-infra && cd my-first-infraAdd the following to main.tf:
terraform {
required_version = ">= 1.6.0"
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 2.0"
}
}
}
provider "openstack" {}
data "openstack_images_image_v2" "ubuntu_2404" {
name = "Ubuntu-24.04"
most_recent = true
}
resource "openstack_compute_instance_v2" "my_server" {
name = "my-first-server"
flavor_name = "s1a.small"
block_device {
uuid = data.openstack_images_image_v2.ubuntu_2404.id
source_type = "image"
destination_type = "volume"
volume_size = 10
delete_on_termination = true
}
network {
name = "PublicEphemeral"
}
}This configuration declares a single compute instance running Ubuntu 24.04 on PublicEphemeral, the shared public network suitable for short-lived test VMs. The "Next steps" section below routes you to the Simple VM template once you are ready to add a floating IP, a security group, and a private network behind a router.
Initialize and deploy#
Initialize the project to download the OpenStack provider:
tofu initPreview what OpenTofu creates:
tofu planThe plan output shows the resources OpenTofu creates. Review it to confirm the instance name, image, and flavor match your intent.
Apply the configuration to create the instance:
tofu applyType yes when prompted. OpenTofu creates the compute instance and writes the resource state to a local terraform.tfstate file.
Verify the instance#
Check the instance status through the OpenStack CLI or the Quake AI dashboard. You can also query the state:
tofu showThis displays the current state of all managed resources, including the instance ID, IP address, and status.
Clean up#
To destroy the instance and all associated resources:
tofu destroyType yes when prompted. OpenTofu removes every resource it created.
Next steps#
You now have a working OpenTofu setup for Quake AI. From here:
- Add a floating IP and security group to make the instance reachable; see the Simple VM template
- Learn about remote state management to share state across a team
- Explore the full template library for repeatable patterns
- Read IaC on Quake AI for tool comparison
See also#
Usage Guidelines
The sample code, software libraries, command line tools, proofs of concept, templates, and other related technology on this page (including any of the foregoing that is provided by Quake AI personnel) is provided to you as Quake AI Content under the Quake AI Customer Agreement, or the relevant written agreement between you and Quake AI (whichever applies). Do not use this Quake AI Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the Quake AI Content (such as sample code) as appropriate for production grade use based on your specific quality control practices and standards. Deploying Quake AI Content may incur Quake AI charges for creating or using Quake AI chargeable resources, such as running Compute instances or storing data in Object Storage. Your use is also subject to the Acceptable Use Policy.
For the full policy, see Usage Guidelines.
Last validated: 25.05.2026