hashicorp / terraform-provider-infoblox

This provider has moved to https://github.com/infobloxopen/terraform-provider-infoblox
https://github.com/infobloxopen/terraform-provider-infoblox
Mozilla Public License 2.0
12 stars 22 forks source link

Error: updating CNAME record is not supported #36

Open deromemont opened 4 years ago

deromemont commented 4 years ago

When I try to update a CNAME record For exemple:

resource "infoblox_cname_record" "test-update" {
  canonical="www.google.com"
  zone="myzone.net"
  alias="test-update"
  tenant_id="tenant-id"
  dns_view="view"
}

Creation is OK

But I try to update

resource "infoblox_cname_record" "test-update" {
  canonical="www.google.com"
  zone="myzone.net"
  alias="test-update2"
  tenant_id="tenant-id"
  dns_view="view"
}
Plan: 0 to add, 1 to change, 0 to destroy.
infoblox_cname_record.test-update: Modifying... [id=record:cname/xxxxxxxxxx]
"Error: updating CNAME record is not supported"

If the infoblox API doesn't support update, could you make a destroy / creation of the object like other provider in terraform

Thx

schlitzered commented 4 years ago

the same problem exists for a and ptr records. technically the IB API supports changing records. it is "just" not implemented

donwlewis commented 3 years ago

I think the quickest fix for this would just be to delete and create the record. I would like to see this implemented as well.

deromemont commented 3 years ago

Yes but we have an automated workflow ans it's hard to ask users to destroy one cname ans recreate it ...

It's not possible to declare this ressource not updatable ? For example, when you modify some ressource on aws provider, for some modification, the only solution is to destroy and recreate. So i think there are a mecanism on terraform api side

donwlewis commented 3 years ago

I think it would just be a matter of adding this to the schema of the fields you would want to force a new resource to be created:

https://www.terraform.io/docs/extend/schemas/schema-behaviors.html#forcenew

Basically doing something like

"vm_name": &schema.Schema{
    Type:        schema.TypeString,
    Required:    true,
        ForceNew:    true,
    Description: "The name of the VM.",
}
schlitzered commented 3 years ago

i would suggest to not do a create/delete. and instead make use of the update feature of the IB API.

afaik IB increments the zone serial on every write, which means that also a notify would be send for every write.

this could lead to a short time where a record is not available. because it would be deleted first.

this might not be what users expect, and can lead to unexpected errors in name resolution.