terraform-provider-powerdns
terraform-provider-powerdns copied to clipboard
Initial SOA records conflicting with `INCEPTION-INCREMENT`
to create a SOA record for a domain i have to use powerdns_record like this:
resource "powerdns_record" "SOA_example_com" {
zone = "example.com."
name = "example.com."
type = "SOA"
ttl = 3600
records = ["dns1.example2.com. hostmaster.example.com. 2019120101 10800 3600 3600000 3600"]
}
which creates a record with this entry. if i have set my soa_edit_api to empty according #29 it works like charm but of course it is much better to have set the serial automatically. so if i set soa_api_edit to INCEPTION-INCREMENT i get a conflict because the serial got increased automatically and isn't equal to the serial set in the terraform config before:
- running
terraform applycreates the soa record (with the config above) - the serial gets increased automatically
- running
terraform applyagain results in this:
id: "example.com.:::SOA" => <computed> (forces new resource)
name: "example.com." => "example.com."
records.#: "1" => "1"
records.xxxxxxxxx9: "ns1.example2.com. hostmaster.example.com. 2019120102 10800 3600 3600000 3000" => "" (forces new re
records.xxxxxxxxx2: "" => "ns1.example2.com. hostmaster.example.com. 2019120101 10800 3600 3600000 3000" (forces new re
ttl: "3600" => "3600"
type: "SOA" => "SOA"
zone: "example.com." => "example.com."
so how to use this provider to create an initial SOA record but increase the serial without this conflict?
maybe this would be an own ticket or its a reopen of #29 or its ok to put it here:
- having setup a soa record for example domain with terraform
terraform applyruns with no errors or actions- add a new record to an non-existing domain (made a typo) where
soa-edit-apiis set toINCEPTION-INCREMENT - running
terraform applyresults inFailed to create PowerDNS Record: Error creating record set: example_com.:::MX, reason: "Could not find domain 'example_com.'"which is correct because of the typo - fixing the typo ->
example_com->example.com terraform applyresults in the error fo #29 (see below)
-/+ powerdns_record.SOA_example_com (new resource required)
id: "example.com.:::SOA" => <computed> (forces new resource)
name: "example.com." => "example.com."
records.#: "1" => "1"
records.2145257032: "dns1.example2.com. hostmaster.example.com. 2019120202 10800 3600 3600000 3000" => "" (forces new resource)
records.2374626224: "" => "dns1.example2.com. hostmaster.example.com. 2019120102 10800 3600 3600000 3000" (forces new resource)
ttl: "3600" => "3600"
type: "SOA" => "SOA"
zone: "example.com." => "example.com."
* powerdns_record.SOA_example_com (destroy): 1 error(s) occurred:
* powerdns_record.SOA_example_com: Error deleting PowerDNS Record: Error deleting record: example.com. SOA, reason: "No SOA found for domain 'example.com.'"
* powerdns_record.MX_example_com: 1 error(s) occurred:
* powerdns_record.MX_example_com: Failed to create PowerDNS Record: Error creating record set: example.com.:::MX, reason: "No SOA found for domain 'example.com.'"
i have to connect to powerdns and change the soa-edit for the domain to '' and rerun terraform apply
shouldn't the soa record be set via powerdns_zone and such conflicts handled in the provider?
Would it make sense to support a special SOA serial such as 0 one could use in combination with soa-edit-api which will override the serial anyway? The provider would just need to ignore changes to it if the resource uses the special value.