Knowledge base

Using the Terraform provider (zinn-digital/zinn)

Add the zinn-digital/zinn provider from the Terraform Registry, create an API key, and manage DNS records as code — create, update, import — and read your sites, domains, plans and hosting regions as data sources.

zinn-digital/zinn is our official Terraform provider, published on the Terraform Registry with signed releases. It manages DNS records on the domains in your organisation, and it reads your sites, domains, plans and hosting regions as data sources. Sites, mailboxes and plans themselves are not managed by Terraform today — use the dashboard, the API, the SDKs or the Zinnector® CLI for those.

Install

terraform {
  required_providers {
    zinn = {
      source = "zinn-digital/zinn"
    }
  }
}

# api_key falls back to ZINN_API_KEY.
provider "zinn" {}

Run terraform init. Terraform downloads the provider from the registry and checks its signature.

Create an API key

Open the API keys page of your dashboard (app.zinndigital.com/api-keys) and press Create a key. For managing DNS, tick sites.view and domains.dns.manage under Permissions. Export it before running Terraform:

export ZINN_API_KEY=zdk_live_…

The zinn_regions and zinn_plans data sources need no key.

Manage a DNS record

data "zinn_regions" "all" {}
data "zinn_domains" "all" {}

resource "zinn_dns_record" "www" {
  domain_id = one([for d in data.zinn_domains.all.domains : d.id if d.fqdn == "example.com"])
  name      = "www"
  type      = "CNAME"
  value     = "example.com."
  ttl       = 3600
}

output "regions" { value = [for r in data.zinn_regions.all.regions : r.slug] }

terraform apply creates the record; changing value or ttl updates it in place; removing the block deletes it. name accepts @ for the apex, a relative name such as www, or a full name.

Bring an existing record under Terraform

terraform import zinn_dns_record.www <domain_id>/<record_id>

The domain id comes from data.zinn_domains; the record id is shown by the API's DNS record list.

Read your inventory

data "zinn_sites" "all" {}
data "zinn_plans" "agency" { product_line = "agency" }

output "site_count" { value = length(data.zinn_sites.all.sites) }
output "agency_plans" { value = [for p in data.zinn_plans.agency.plans : p.code] }

Provider settings

  • api_key — the API key; defaults to ZINN_API_KEY.
  • api_url — defaults to ZINN_API_URL, then https://api.zinndigital.com.
  • org — the organisation to act on; defaults to ZINN_ORG. Usually unnecessary, because a key belongs to one organisation.

Where to go next

  • The guide on our website: zinndigital.com/developers/terraform
  • The provider on the Terraform Registry: registry.terraform.io/providers/zinn-digital/zinn
  • Source code: github.com/Zinn-Digital/terraform-provider-zinn

All developer docs →

Latest from the blog

What we have been writing about hosting, SEO and running sites at scale.

SEO and Link Building from the Hosting Layer: A 2026 Operator's View

How hosting shapes indexing and link equity in 2026: keeping pages indexed, vetting aged domains before you build on them, link building without a footprint, and an honest line on what infrastructure can and cannot do for SEO.

Read the post →

Making WordPress Fast and Secure: A Performance and Plugin Checklist

A practical checklist for fast, secure WordPress: server-level caching, a per-site object cache, the handful of plugins worth running, keeping the stack current, and the WooCommerce pages you must never cache.

Read the post →

How to Choose Managed Web Hosting in 2026: A Buyer's Guide

What actually separates good managed hosting from a cheap box with a control panel — migrations, backups, isolation, real caching and honest scaling — and how to judge it before you commit.

Read the post →

Read the blog →

Still stuck?

Support is included on every plan, the desk is open 24 hours a day, and you can write to us in any of our 58 languages — we answer you in yours.

Contact support → All articles →