Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

Error: updating CNAME record is not supported #36

Open
deromemont opened this issue Nov 16, 2020 · 5 comments
Open

Error: updating CNAME record is not supported #36

deromemont opened this issue Nov 16, 2020 · 5 comments

Comments

@deromemont
Copy link

deromemont commented Nov 16, 2020

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
Copy link

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

@donwlewis
Copy link

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
Copy link
Author

deromemont commented Nov 30, 2020

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
Copy link

donwlewis commented Nov 30, 2020

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
Copy link

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.

deromemont added a commit to deromemont/terraform-provider-infoblox that referenced this issue Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants