Skip to main content
This guide takes you from nothing to a running compute instance, managed entirely by Terraform.
1

Install Terraform

Install Terraform from the official downloads if you don’t have it yet, then confirm it’s on your path:
2

Create an API key

In the Strettch Cloud console, create an API key, then expose it to Terraform:
Treat the key like a password. Never commit it to version control; in CI, store it as a secret.
3

Configure the provider

Create a main.tf and declare the provider:
main.tf
4

Define your first compute

Add a compute instance and output its public IP:
main.tf
Replace public_keys with your own SSH public key so you can log in once the instance is up.
5

Initialize and apply

Download the provider, preview the plan, then create the instance:
Terraform prints the public_ip output when the apply completes — SSH in with the key you provided.
6

Clean up

When you’re done, tear everything down:

Look up catalog values

Rather than pinning an image, region, or size to a slug that might change, look them up as data sources and reference the result:
You can also fetch a single entry — for example, pick a specification by size without hardcoding its slug:

Next steps

Full reference

Every resource, data source, and argument on the Terraform Registry.

Reboot on demand

Trigger a reboot from the command line or a lifecycle event (Terraform 1.14+).