
If you already use Terraform, your MozOut VPS servers, domains and DNS records can live in the same files as everything else. You describe what you want, run terraform apply, and the provider makes the changes through our public API.
What it does
It has three resources. mozout_vps buys a VPS with credit, or manages one you have: power state, time zone and reverse DNS. mozout_domain registers a domain, or manages one you have: nameservers, transfer lock and renewal. mozout_dns_record handles the records of the DNS zone: A, AAAA, CNAME, MX, TXT, NS, SRV and CAA.
It also has five read-only data sources: products for sale and their prices (mozout_catalog_products and mozout_catalog_product), domain extensions (mozout_catalog_tlds), whether a domain can be registered (mozout_domain_availability) and your servers (mozout_servers).
What you need
Terraform, and an account with MozOut that has an API key. You create the key in the API Center of My MozOut. Go 1.22 or later is only needed if you want to build the provider from source.
Installing, step by step
|
|
|
The example from the README creates an A record for www:
terraform {
required_providers {
mozout = {
source = "mozout-com/mozout"
version = "~> 1.0"
}
}
}
provider "mozout" {}
resource "mozout_dns_record" "www" {
domain = "example.com"
name = "www"
type = "A"
value = "203.0.113.10"
ttl = 3600
}
export MOZOUT_API_KEY="sandbox_..."
terraform init
terraform apply
More examples and the full reference are in the provider repository. To build it yourself, download the source of the latest release and run:
go mod tidy
go build -o terraform-provider-mozout
go test ./...
To try your own build, point Terraform to it in ~/.terraformrc. The English README shows how.
The API key and its permissions
Purchases (a VPS, a domain registration) are paid with your account credit, within the spending limit of the key. Give the key the permissions for the areas your code will manage: see which permission each task needs.
Testing without spending
Start with a sandbox_ key. It reads your real data, but every write is simulated and nothing is charged. Once the plan does what you expect, swap it for a prod_ key.
Good to know
No double charges: each purchase goes with its own Idempotency-Key, so a retry never charges twice.
Destroy does not cancel: the API cannot cancel services or delete domains. terraform destroy only removes them from the state. You cancel in My MozOut.
A VPS you already bought: its purchase settings cannot change after the purchase. If you change them, the provider stops the plan instead of buying a second server.
Errors: 429 and 5xx answers are retried. Errors show the API code and the correlation_id for support.
Help
If the provider shows an error you do not understand, open a support ticket and include the correlation_id from the message. The code is in the provider repository, under the MIT license.
|
Ready to manage your account as code? Download the latest release |
|
SEE ALSO |
RECOMMENDED PRODUCT VPS server with root access Resources of your own, the OS you choose, reinstall whenever you like. from £6.72/mo (3-year plan, with coupon) See plans |











