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
- Install the XenonCloud Terraform provider.
- Set
TF_VAR_xenon_tokenin your environment. - Run
terraform init, thenterraform planandterraform apply.