Terraform is an open-source infrastructure as code software tool created by HashiCorp. Users define and provide data center infrastructure using a declarative configuration language known as HashiCorp Configuration Language, or optionally JSON.
Create a new Linux 1.5GB VPS XENLIT
in Auckland, NZ AKLCITY
with Ubuntu Jammy ubuntu-jammy-pvh.amd64
.
main.tf
file with this content.terraform {
required_providers {
sitehost = {
source = "sitehostnz/sitehost"
version = "~> 1.0"
}
}
}
provider "sitehost" {
client_id = "****"
api_key = "***"
api_endpoint = "https://api.sitehost.nz/1.1/"
}
resource "sitehost_server" "web" {
label = "webserver"
location = "AKLCITY"
product_code = "XENLIT"
image = "ubuntu-jammy-pvh.amd64"
}
To get an API KEY you must create it from your Sitehost control panel. You can find out how to do this in our knowledge base.
terraform init && terraform apply --auto-approve
Run the terraform commands to delete the VPS
terraform destroy --auto-approve
Be aware this command cannot be reversed and will completely remove the server.
You can check the complete list with all locations, product codes and images available to deploy a Linux/Windows VPS using our terraform provider
You can see the complete documentation about our provider on Terraform Registry.