Skip to content

A Terraform provider for PowerDNS GSLB server to manage LUA records through DNS updates (RFC2136).

License

Notifications You must be signed in to change notification settings

dmachard/terraform-provider-powerdns-gslb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Provider PowerDNS GLSB records

pdns-auth 4.9 pdns-auth 4.8

A Terraform provider for PowerDNS server to manage LUA records through DNS updates (RFC2136). This provider can be to used to have a dynamic behaviour of your PowerDNS server, such as Global Server Load Balancing.

Requirements

Using the Provider

terraform {
  required_providers {
    powerdns-gslb = {
      version = "1.4.0"
      source  = "dmachard/powerdns-gslb"
    }
  }
}

# Configure the DNS Provider
provider "powerdns-gslb" {
    server        = "10.0.0.210"
    key_name      = "test."
    key_algo      = "hmac-sha256"
    key_secret    = "SxEKov9vWTM+c7k9G6ho5nKX1cJN.....ND5BOHzE6ybvy0+dw=="
}

# Generic LUA record
resource "powerdns-gslb_lua" "foo" {
  zone = "home.internal."
  name = "foo"
  record {
    rrtype = "A"
    ttl = 5
    snippet = "ifportup(8082, {'10.0.0.1', '10.0.0.2'})"
  }
  record {
    rrtype = "TXT"
    ttl = 15
    snippet = "os.date()"
  }
}

For detailed usage see provider's documentation page

PowerDNS tuning

Update your pdns.conf configuration file to enable LUA records and DNS update features.

enable-lua-records=yes
dnsupdate=yes

Then enable the TSIG mechanism, AXFR and DNSUPDATE on your dns zone test.internal

pdnsutil create-tsig-key tsigkey hmac-sha256
pdnsutil set-meta test.internal TSIG-ALLOW-DNSUPDATE tsigkey
pdnsutil set-meta test.internal TSIG-ALLOW-AXFR tsigkey
pdnsutil set-meta test.internal ALLOW-DNSUPDATE-FROM 0.0.0.0/0

About

A Terraform provider for PowerDNS GSLB server to manage LUA records through DNS updates (RFC2136).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages