Terraform Provider
Manage your DNS zones as code with the hiddenprimary.ch Terraform provider.
Installation
The provider is published in the Terraform Registry. Declare it and run
terraform init — there is nothing to build and nothing to place by hand.
Releases are signed; terraform init verifies the signature and records the
checksums in your lock file. Source and issue tracker:
github.com/hiddenprimary/terraform-provider-hiddenprimary.
Provider Configuration
Create an API key in the portal under Account → API keys. Zone
operations need the zones:read and zones:write scopes; the
plans data source also needs billing:read.
Or leave the block out entirely and use the environment. Prefer this, or a variable
marked sensitive — a key written into a .tf file ends up
in version control.
| Argument | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | API key, sensitive. May come from HIDDENPRIMARY_API_KEY instead of the configuration. |
api_url | string | no | Defaults to https://hiddenprimary.ch/v1. May also be set with HIDDENPRIMARY_API_URL. |
Resources
hiddenprimary_zone
Manages a DNS zone.
Leave primary_ips out for a zone whose content you upload, or whose
nameserver sits on an address that changes and identifies itself by an authenticated
NOTIFY instead.
| Argument | Type | Required | Description |
|---|---|---|---|
name | string | yes | Domain name (e.g. example.ch). Changing it replaces the zone. |
primary_ips | list(string) | no | Addresses of your own nameserver, which we transfer the zone from. |
| Attribute | Type | Description |
|---|---|---|
id | string | Numeric zone ID. |
status | string | Zone status (active, pending, error). |
serial | number | SOA serial of the copy currently served. |
transfer_method | string | The stored transfer method: axfr or ixfr. Every new zone is created as axfr, and uploading a zone file does not change it. The value does not pick the wire protocol: whether a refresh runs as a full or incremental transfer is negotiated per RFC 1995 and cannot be pinned per zone. |
Data Sources
hiddenprimary_zone
Look up an existing zone by name.
hiddenprimary_plans
List the available plans. Needs the billing:read scope.
price_monthly is in cents.
Import Existing Zones
The ID is the numeric zone ID from the portal or the API.