Closed vintury closed 1 year ago
Hello @vintury ,
It looks like there is an instance of dnsaddrec
with the same name that you have specified in the above configuration file please check your ADC using CLI.
Thanks, Rohit
Hello @rohit-myali Thank you. You are right. I tried to create another DNS record, but have this issue:
$ terraform apply -auto-approve
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:
# module.test_dns.citrixadc_dnsaddrec.dnsaddrec will be created
+ resource "citrixadc_dnsaddrec" "dnsaddrec" {
+ hostname = "hohoho.net"
+ id = (known after apply)
+ ipaddress = "10.200.211.129"
+ ttl = 3600
}
Plan: 1 to add, 0 to change, 0 to destroy.
module.test_dns.citrixadc_dnsaddrec.dnsaddrec: Creating...
╷
│ Error: [ERROR] nitro-go: Failed to create resource of type dnsaddrec, name=hohoho.net, err=failed: 400 Bad Request ({ "errorcode": 1074, "message": "Invalid value [set command not present for this resource]", "severity": "ERROR" })
│
│ with module.test_dns.citrixadc_dnsaddrec.dnsaddrec,
│ on modules/dns/main.tf line 1, in resource "citrixadc_dnsaddrec" "dnsaddrec":
│ 1: resource "citrixadc_dnsaddrec" "dnsaddrec" {
│
╵
Cleaning up file based variables
ERROR: Job failed: exit code 1
My resource.tf file is:
terraform {
backend "pg" {}
required_providers {
citrixadc = {
source = "citrix/citrixadc"
version = "1.25.0"
}
}
}
resource "citrixadc_dnsaddrec" "dnsaddrec" {
hostname = "hohoho.net"
ipaddress = "10.200.211.129"
ttl = 3600
}
I tried to change hostname to another root domain, and all is ok. @rohit-myali do you know limitations for creating domains?
$ terraform apply -auto-approve
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:
# module.test_dns.citrixadc_dnsaddrec.dnsaddrec will be created
+ resource "citrixadc_dnsaddrec" "dnsaddrec" {
+ hostname = "hohoho.uz"
+ id = (known after apply)
+ ipaddress = "10.200.211.129"
+ ttl = 3600
}
Plan: 1 to add, 0 to change, 0 to destroy.
module.test_dns.citrixadc_dnsaddrec.dnsaddrec: Creating...
module.test_dns.citrixadc_dnsaddrec.dnsaddrec: Creation complete after 0s [id=hohoho.uz]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
I think terraform provider can't create fake record if same record registered on root zone. But citrix adc has not same problems, and You can add fake record manually.
> add dns addRec hohoho.net 11.1.1.1
Done
I have the same issue with real data. I ran it to generate 73 records and it fail 39 times with the same 1074 error code I ran it again and it generate 20 and fail 19 times with the same 1074 error code I ran it again and it generate 10 and fail 9 times with the same 1074 error code etc.
We have two netscaler for resilience. What is interesting is that I ran it on the inactive netscaler and I saw no issues. The netscaler that is causing the issue is the active netscaler.
What is also interesting is that when I look at the A Records in the active netsclaer, I briefly saw an A Record (which failed) with type=proxy, when I look again it was gone.
What is also interesting is that when I look at the A Records in the active netsclaer, I briefly saw an A Record (which failed) with type=proxy, when I look again it was gone.
I also had this issue once. The problem is that you cannot create a a
record for a record which is already in the cache (proxy
) (e.g. because you did a dig
/ping
on the shell or a VPN client requested a lookup for the domain).
My workaround is the following - i flush the cache on and create the record manually.
flush proxyRecords
add dns addRec mdm.example.com 192.168.8.50 -ttl 60
And then i imported the records in terraform instead of creating them with terraform.
terraform import citrixadc_dnsaddrec.dnsaddrec.mdm_record mdm.example.com
Maybe the terraform provider could check for existing proxy records first before creating the real record. But in my opinion this is a general problem in the Nitro API design.
I'm using terragrunt and thinking of putting a catch on the error and retry. That might work around it, if try it enough time but not great.
Hello Everyone, We have fixed this issue and it is currently being reviewed. It will be updated in our next release. I will update the same here.
Thanks, Rohit
Hello Everyone,
We have fixed this issue and it is been released in Terraform registry, version 1.27.0.
Please find the link to the documentation of citrixadc_dnsaddrec
here
Contact us
Bug Report
Describe the bug Terraform provider can't create dns A record
To Reproduce Steps to reproduce the behaviour:
My terraform files are
resource "citrixadc_dnsaddrec" "dnsaddrec" { hostname = "a.root-servers.net" ipaddress = "65.200.211.129" ttl = 3600 }
Error: [ERROR] nitro-go: Failed to create resource of type dnsaddrec, name=hohoho.net, err=failed: 400 Bad Request ({ "errorcode": 1074, "message": "Invalid value [set command not present for this resource]", "severity": "ERROR" }) │ │ with module.test_dns.citrixadc_dnsaddrec.dnsaddrec, │ on modules/dns/main.tf line 9, in resource "citrixadc_dnsaddrec" "dnsaddrec": │ 9: resource "citrixadc_dnsaddrec" "dnsaddrec" { │ ╵