Closed sempervictus closed 4 months ago
We're looking at API-driven providers which have a TF provider to escape GoDaddy's decision to pay-gate their API. Hoping ClouDNS might offer this functionality - are there any plans to finalize this provider in the near term, or should we come back in a bit to see how this effort is going?
Hello,
Is it possible to provide the tf file for the DNS zone creation that is applied so we can check further?
Is the tf provider used with API sub user or API user?
Thanks for pinging back. the relevant TF code is:
locals {
a = {
"@": "127.127.127.127",
"*": "127.127.127.127",
"something": openstack_networking_floatingip_v2.i1_pub.address,
"somethingelse": openstack_networking_floatingip_v2.i2_pub.address
}
mx = {
"@": "smtp.relay"
}
cname = {
"www": "@",
}
txt = {
"@": "v=spf1 include:spf.smtp.relay ~all"
}
}
# https://www.cloudns.net/wiki/article/516/
resource "cloudns_dns_zone" "somedomain-com" {
domain = "somedomain.com"
type = "master"
}
resource "cloudns_dns_record" "somedomain-com-a" {
for_each = local.a
name = each.key
zone = cloudns_dns_zone.somedomain-com.domain
type = "A"
value = each.value
ttl = "600"
depends_on = [ cloudns_dns_zone.somedomain-com ]
}
resource "cloudns_dns_record" "somedomain-com-mx" {
for_each = local.mx
name = each.key
zone = cloudns_dns_zone.somedomain-com.domain
type = "MX"
value = each.value
ttl = "600"
depends_on = [ cloudns_dns_zone.somedomain-com ]
priority = ((index(keys(local.mx), each.key) + 1 ) * 10)
}
resource "cloudns_dns_record" "somedomain-com-cname" {
for_each = local.cname
name = each.key
zone = cloudns_dns_zone.somedomain-com.domain
type = "CNAME"
value = each.value
ttl = "600"
depends_on = [ cloudns_dns_zone.somedomain-com ]
}
resource "cloudns_dns_record" "somedomain-com-txt" {
for_each = local.txt
name = each.key
zone = cloudns_dns_zone.somedomain-com.domain
type = "TXT"
value = each.value
ttl = "600"
depends_on = [ cloudns_dns_zone.somedomain-com ]
}
The API key is for the main account (only account) created.
Hello,
We have done some fixes on the issue and released a new v1.0.1.
Could you please update the version in the provider tf and try once again to create the test zone and records?
Thank you @Venkoul99! Awesome turn-around:
cloudns_dns_zone.somedomain-com: Creating...
cloudns_dns_zone.somedomain-com: Creation complete after 1s [id=somedomain.com]
cloudns_dns_record.somedomain-com-a["@"]: Creating...
cloudns_dns_record.somedomain-com-mx["@"]: Creating...
cloudns_dns_record.somedomain-com-cname["www"]: Creating...
cloudns_dns_record.somedomain-com-txt["@"]: Creating...
cloudns_dns_record.somedomain-com-a["*"]: Creating...
cloudns_dns_record.somedomain-com-cname["www"]: Creation complete after 1s [id=501294762]
cloudns_dns_record.somedomain-com-a["@"]: Creation complete after 1s [id=501294772]
cloudns_dns_record.somedomain-com-mx["@"]: Creation complete after 1s [id=501294776]
cloudns_dns_record.somedomain-com-txt["@"]: Creation complete after 2s [id=501294780]
cloudns_dns_record.somedomain-com-a["*"]: Creation complete after 2s [id=501294782]
have not tried importing resources yet but looks like state is now consistent:
No changes. Your infrastructure matches the configuration.
Thank you for the update @sempervictus !
We'll go ahead and close this issue for now. If you encounter any further problems or have any other questions, please don't hesitate to reach out to us again.
DNS zone resources cannot be imported and are broken when created - simply creating one, then running the same (unchanged)
apply
action will attempt re-create it then fail to destroy the original object withtrying to create a zone and records all in the same
apply
operation produces:The provider is also unable to
import
resources