Skip to main content
The Infinite Compute Terraform provider manages servers, volumes, volume attachments and SSH keys through the API.

Install the provider

Terraform installs the provider from the Terraform Registry when you run terraform init; the required_providers block below is all it needs. Releases are signed, and Terraform checks the signature.

Configure

Create an API key with the Read and write scope and export it, with your API address (your console address followed by /api/public/v1; the console address is in your welcome email):

A server with a volume and SSH access

Save this as main.tf:
Replace <server type> and <image> with names from your console, or from ic server-types and ic images. The server types available to you depend on your agreement. Then:
terraform apply waits until the server is active (up to 20 minutes by default). Running terraform plan again shows no changes.

Resources and data sources

Existing resources can be brought under Terraform with terraform import: servers and volumes by id, SSH keys by name, attachments by <server id>/<volume id>.

Clean up

This deletes the attachment, the volume, the server and the SSH key. Copy anything you want to keep off the server and the volume first.
The provider sends an Idempotency-Key with every create, so a retried apply never launches a second server.