Works with Technitium v13.x API
Provider documentation is available at registry.terraform.io/kenske/technitium.
Add the provider to your Terraform configuration:
terraform {
required_providers {
technitium = {
version = "~> 0.2.2"
source = "registry.terraform.io/kenske/technitium"
}
}
}
Then, configure the provider with the host and token:
provider "technitium" {
host = var.TECHNITIUM_HOST
token = var.TECHNITIUM_TOKEN
}Alternatively, the values can be set using the TECHNITIUM_HOST and
TECHNITIUM_TOKEN environment variables.
Complete example:
terraform {
required_providers {
technitium = {
source = "registry.terraform.io/kenske/technitium"
}
}
}
provider "technitium" {
host = var.TECHNITIUM_HOST
token = var.TECHNITIUM_TOKEN
}
resource "technitium_dhcp_scope" "test" {
name = "Test1"
starting_address = "10.0.0.2"
ending_address = "10.0.0.254"
subnet_mask = "255.255.255.0"
router_address = "10.0.0.1"
domain_name = "local"
use_this_dns_server = false
dns_servers = [
"1.1.1.1",
"8.8.8.8"
]
exclusions = [
{
starting_address = "10.0.0.10"
ending_address = "10.0.0.40"
},
{
starting_address = "10.0.0.240"
ending_address = "10.0.0.250"
}
]
}
resource "technitium_dhcp_reserved_lease" "test" {
name = technitium_dhcp_scope.test.name
hardware_address = "00:11:22:33:44:56"
ip_address = "10.0.0.9"
host_name = "test-host"
comments = "This is a test reserved lease"
}
resource "technitium_dns_zone" "example" {
name = "example.com"
type = "Primary"
use_soa_serial_date_scheme = true
}
resource "technitium_dns_zone_record" "cname" {
zone = technitium_dns_zone.example.name
domain = "cname.${technitium_dns_zone.example.name}"
type = "CNAME"
cname = "other.example.com"
comments = "This is a test CNAME record"
ttl = "420"
depends_on = [technitium_dns_zone.example]
}
resource "technitium_dns_zone_record" "a" {
domain = "testa.example3.com"
type = "A"
ip_address = "1.1.1.1"
comments = "This is a test A record"
ttl = "420"
depends_on = [technitium_dns_zone.example]
}
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
installcommand: - Setup the override in your
~/.terraformrcfile as described in the Terraform provider documentation:
provider_installation {
dev_overrides {
"registry.terraform.io/kenske/technitium" = "/path/to/go/bin" # e.g. /home/user/go/bin
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
- Use
TF_LOG_PROVIDER=debugto enable debug logging for the provider.