Closed markus-volkert-mint closed 2 months ago
Hello @markus-volkert-mint,
If I understand your issue correctly, you have currently two issues:
ovh_domain_zone_record
resource with a ttl
value of 0
, which is not allowed by the provider at the moment.On the first issue, this is a problem on the provider side and we will address this.
On the second issue, this is not how the provider and the OVHcloud API work. If you want to handle a previously created DNS zone record using Terraform, you should use the import
statement in order to have the resource handled by Terraform.
After we fix the first issue, you will still have duplicates if you create the same record than you created on the UI, and that would be normal. You need to use the import
statement for that.
Feel free to correct if we misunderstood stuff here. In the mean time, I will change the title of this issue and it will be picked-up by someone on my team.
Thanks Romain
Hi @rbeuque74,
thanks for getting back so quickly and clarifying! I'm new to terraform and had not understood that I had to import existing DNS records before being able to manage them via terraform. I believed it was a result of the existing record and the terraform managed record having different ttls.
So, allowing the ttl to be 0 to make use of the default values will be good, but won't actually solve the issue with the duplicated entries, that was simply user-failure..
Thanks for pointing me in the right direction!
Thanks Markus
Describe the bug
When a DNS zone record is defined in terraform where the terraform TTL is identical to the default TTL for the DNS zone in OVH, duplicated records are created. Cause is most likely, that OVH internally represents records that use the default TTL with a TTL of '0'. In the "ovh_domain_zone_record" resource, TTL is required to be > 60, and thus cannot be set to '0'.
Terraform Version
code
Terraform v1.8.4 on windows_amd64code
OVH Terraform Provider Version
code
.\terraform.exe initInitializing the backend...
Initializing provider plugins...
code
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
No debug info available.
Panic Output
No panic output.
Expected Behavior
The provider should have noticed that there already is a matching domain zone record and not have created a second entry.
Actual Behavior
A second domain zone record has been created with a TTL of 3600, although a record already existed with a TTL of '0', which represents the default, which is '3600'.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply