pan-net / terraform-provider-powerdns

Terraform PowerDNS provider
https://www.terraform.io/docs/providers/powerdns/
Mozilla Public License 2.0
44 stars 48 forks source link

Introducing data source for PTR record generation #94

Open johannwagner opened 2 years ago

johannwagner commented 2 years ago

This introduces a data source, which can generate a PTR record on the fly with an ip address as parameter. This fixes #93.

Example:

data "powerdns_ptr" "foo" {
    ip_address = "1.2.3.4"
}

resource "powerdns_record" "foobar" {
  zone    = "in-addr.arpa."
  name    = data.powerdns_ptr.foo.ptr_address
  type    = "PTR"
  ttl     = 300
  records = ["www.example.com."]
}
johannwagner commented 2 years ago

I would also like to add documentation, since this is a user-facing feature, but currently there are no instructions on building or using the documentation part.

baryluk commented 8 months ago

LGTM in general, but the looping can be done simpler.