You can find resources and data sources documentation there or here.
This project has been forked from timohirt/terraform-provider-hetznerdns, which is no longer maintained.
- Terraform > v1.0
You most likely want to download the provider from Terraform Registry. The provider is also published in the OpenTofu Registry.
If you previously used the timohirt/hetznerdns
provider, you can easily replace the provider in your terraform state
by following our migration guide in the provider documentation.
This provider is published and available there. If you want to use it, just
add the following to your terraform.tf
:
terraform {
required_providers {
hetznerdns = {
source = "germanbrew/hetznerdns"
version = "3.0.0" # Replace with latest version
}
}
required_version = ">= 1.0"
}
Then run terraform init
to download the provider.
Once installed, you have three options to provide the required API token that is used to authenticate at the Hetzner DNS API.
You can enter it every time you run terraform
.
Add the following to your terraform.tf
:
variable "hetznerdns_token" {}
provider "hetznerdns" {
api_token = var.hetznerdns_token
}
Now, assign your API token to hetznerdns_token
in terraform.tfvars
:
hetznerdns_token = "kkd993i3kkmm4m4m4"
You don't have to enter the API token anymore.
Assign the API token to HETZNER_DNS_TOKEN
env variable.
export HETZNER_DNS_TOKEN=<your api token>
The provider uses this token, and you don't have to enter it anymore.
- Go 1.21 (to build the provider plugin)
- golangci-lint (to lint code)
- terraform-plugin-docs (to generate registry documentation)
Run the following command
make install-devtools
Check the subcommands in our Makefile for useful dev tools and scripts.
To test the provider locally:
-
Build the provider binary with
make build
-
Create a new file
~/.terraform.rc
and point the provider to the absolute directory path of the binary file:provider_installation { dev_overrides { "germanbrew/hetznerdns" = "/path/to/your/terraform-provider-hetznerdns/bin/" } direct {} }
-
- Set the variable before running terraform commands:
TF_CLI_CONFIG_FILE=~/.terraform.rc terraform plan
- Or set the env variable
TF_CLI_CONFIG_FILE
and point it to~/.terraform.rc
: e.g.
export TF_CLI_CONFIG_FILE=~/.terraform.rc`
-
Now you can just use terraform normally. A warning will appear, that notifies you that you are using an provider override
Warning: Provider development overrides are in effect ...
-
Unset the env variable if you don't want to use the local provider anymore:
unset TF_CLI_CONFIG_FILE