dnsimple / terraform-provider-dnsimple

Terraform DNSimple provider.
https://www.terraform.io/docs/providers/dnsimple/
Mozilla Public License 2.0
22 stars 20 forks source link

Option to Delete Existing Records Before Adding #1

Closed hashibot closed 1 year ago

hashibot commented 7 years ago

This issue was originally opened by @thegranddesign as hashicorp/terraform#5892. It was migrated here as part of the provider split. The original body of the issue is below.


Often when rerunning my applies, Terraform can't figure out that the DNSimple A record is supposed to be updated instead of created. This happens on CNAME (which error out) and A records (which don't). However since multiple A records can be added for a domain, it associates the domain with multiple IPs (which I don't want).

So I'd love some way (maybe an option?) to say "Hey if you see a record for this hostname, delete it before you add it."

semente commented 6 years ago

I have this issue on the current version as well (0.11.4). I think once it is allowed to have multiple host entries in a domain was decided to add new entries instead update it, but in my opinion the default should be to always update. To create multiple entries to a same host the resource should support a list of values.

weppos commented 1 year ago

I was unable to reproduce the issue. It seems like our integration now works correctly, as long as the IDs for the records are different.

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # dnsimple_zone_record.test1 will be created
  + resource "dnsimple_zone_record" "test1" {
      + id             = (known after apply)
      + name           = "test"
      + priority       = (known after apply)
      + qualified_name = (known after apply)
      + ttl            = "60"
      + type           = "A"
      + value          = "1.2.3.5"
      + zone_id        = (known after apply)
      + zone_name      = "dns.solutions"
    }

  # dnsimple_zone_record.test2 will be created
  + resource "dnsimple_zone_record" "test2" {
      + id             = (known after apply)
      + name           = "test"
      + priority       = (known after apply)
      + qualified_name = (known after apply)
      + ttl            = "60"
      + type           = "A"
      + value          = "1.2.3.4"
      + zone_id        = (known after apply)
      + zone_name      = "dns.solutions"
    }

Plan: 2 to add, 0 to change, 0 to destroy.