terraform-provider-mozoutmz/docs/index.md
2026-11-28 15:28:10 +02:00

2.4 KiB

page_title description
MozOut Mozambique Provider Manage MozOut Mozambique VPS servers, domains and DNS records with Terraform.

MozOut Mozambique Provider

Manage your MozOut Mozambique VPS servers, domains and DNS records with Terraform, through the public MozOut Mozambique API (https://docs.mozout.co.mz).

Example

terraform {
  required_providers {
    mozoutmz = {
      source  = "mozout-mz/mozoutmz"
      version = "~> 1.0"
    }
  }
}

provider "mozoutmz" {}
export MOZOUT_API_KEY="sandbox_..."
terraform init
terraform plan

Authentication

Create an API key in Meu MozOut (https://www.meu.mozout.co.mz) with the permissions you need:

What Permissions
Catalog data sources catalog:read
mozoutmz_vps vps:read, vps:write; to buy, also billing:purchase
mozoutmz_domain domains:read, domains:write; to register, also billing:purchase
mozoutmz_dns_record dns:read, dns:write

The provider reads the key from api_key or, when it is not set, from the MOZOUT_API_KEY environment variable. The API address is fixed.

Sandbox first

A sandbox_ key reads the real data of your account, but every write is simulated and nothing is charged. Use it to test your configuration end to end. Resources created with a sandbox key have simulated = true and are kept in the state as placeholders. Switch to a prod_ key when you are ready.

Purchases and destroy

  • Buying a VPS or registering a domain is paid with the account credit, within the spending limit of the key. If the credit is not enough, the error says how much is missing and where to add funds. Nothing is charged twice: each purchase is sent with its own Idempotency-Key, and retries reuse it.
  • The API cannot cancel services or delete domains. terraform destroy only removes them from the state and shows a warning. Cancel in Meu MozOut.
  • The purchase settings of a VPS (product_id, billing_cycle, config_options, promo_code) cannot change after the purchase: the provider refuses rather than buying a second server.

Errors and limits

The provider retries 429 (waiting for Retry-After) and 5xx answers on reads and on requests that carry an Idempotency-Key. Errors show the API code and the correlation_id, to give to support.

Schema

Optional

  • api_key (String, Sensitive) API key. Default: the MOZOUT_API_KEY environment variable.