Running into a problem with creating some DNS vali...
# general
c
Running into a problem with creating some DNS validation records for a domain:
Copy code
+   ├─ cloudflare:index:Record  _81411d169f123acc0172105edadbc20d.<redacted>.-0  created
 +   ├─ cloudflare:index:Record  _81411d169f123acc0172105edadbc20d.<redacted>.-1  **creating failed**     1 error
It is trying to create the same CNAME twice. How can I find this duplicate before trying to create the record resource? Or can I somehow catch the error and say it's fine and abort the second one?
l
With the
-0
and
-1
suffixes at the end of the name, are you looping over a collection somewhere which by accident contains the same CNAME value for the values at index 0 and 1?
c
Yes, I'm looping over the
certificate.domainValidationOptions
. Which I have seen I'll need to do in other cases. In this particular certificate though I get a duplicate for
*.<redacted>.com
and
<redacted>.com
.
Should I remove the index and look for duplicates after the records are created?