Install the provider
Terraform installs the provider from the Terraform Registry when you runterraform 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 asmain.tf:
<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>.