Why Terraform?

Terraform lets you define your XenonCloud resources in version-controlled configuration files. This makes changes auditable and repeatable.

Basic example

terraform {{
  required_providers {{
    xenoncloud = {{
      source  = "xenoncloud/xenoncloud"
      version = "~> 1.0"
    }}
  }}
}}

provider "xenoncloud" {{
  token = var.xenon_token
}}

resource "xenoncloud_instance" "app" {{
  name   = "app-server"
  region = "nyc1"
  plan   = "scale-2"
  image  = "ubuntu-24-04-lts"
}}

Workflow

  1. Install the XenonCloud Terraform provider.
  2. Set TF_VAR_xenon_token in your environment.
  3. Run terraform init, then terraform plan and terraform apply.