Closed simtcrom closed 2 years ago
No, this is not fine. There is a PR pending approval, with some fixes. Besides, changing 'dns_view' field with this lines being removed, actually, changes only your configuration of the resource. The TF state and the object at NIOS side stays unchanged.
Any way while importing I can get the dns_view as well come in to state (right now its null)?
If removing that if condition is a problem, then only way I see is,
import destroy apply
"DNS view" property of CNAME-record is immutable on NIOS side. The Terraform Infoblox provider plugin uses WAPI to communicate with NIOS-server.
I am still trying to understand what is the solution for my problem. How can I update imported resource infoblox_cname_record? I keep getting error "Error: changing the value of 'dns_view' field is not allowed" when I try to apply below on the imported resource.
resource "infoblox_cname_record" "infoblox_cname_record" {
alias = "<IMPORTED CNAME>"
canonical = "helloworldspringbootssl-xxx.xxxxx.xxx.com"
ttl = "60"
comment = "test"
}
I tried adding below to resource_infoblox_cname_record.go and now when I import "dns_view": "default" and now I can manage the resource without issues.
func resourceCNAMERecordGet(d *schema.ResourceData, m interface{}) error {
extAttrJSON := d.Get("ext_attrs").(string)
d.Set("dns_view", "default")
During 'import' operation you should specify all the fields, including those which have some default value. Besides, please try the latest code, that was merged couple of days ago.
During 'import' operation you should specify all the fields, including those which have some default value. Besides, please try the latest code, that was merged couple of days ago.
Could you please show me how it is done on below command?
terraform import infoblox_cname_record.test record:cname/XXXXXXXXXXXXXXXXXXXXXXXXXXXX:helloworldspringbootssl1-dit1.xxx.com/default
Hello,
I am using v2.1.5 to import a cname record as below,
terraform import infoblox_cname_record.test record:cname/XXXXXXXXXXXXXXXXXXXXXXXXXXXX:helloworldspringbootssl1-dit1.xxx.com/default
And as you see dns_view came as null.
Now when I try to update that record I get error,
Error: changing the value of 'dns_view' field is not allowed
I think this is due to https://github.com/infobloxopen/terraform-provider-infoblox/blob/57c847c46a769c6df9261288817535e94606e5fd/infoblox/resource_infoblox_cname_record.go#L132-L134
If I remove above lines and my issue is resolved. Is that an ok thing to do?