Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

sendgrid_domain_authentication always creating new CNAME config and resetting previous one #17

Open
zsozso opened this issue Mar 10, 2022 · 0 comments

Comments

@zsozso
Copy link

zsozso commented Mar 10, 2022

I have problem which is probably related with sendgrid_domain_authentication resource.
Whenever I execute Terraform it is always creating a new Cname records independently from the sendgrid resource was already created
Is it a bug or you have an idea how I can avoid the regeneration?

Thank you

resource "sendgrid_domain_authentication" "default" {
  domain = "${var.dns_zone_name}"
  is_default = true
  automatic_security = true
}

resource "azurerm_dns_cname_record" "sendgrid" {
  depends_on = [
     sendgrid_domain_authentication.default
  ]
  count = 3 // SendGrid generates 3 different CNAME records

  name = trimsuffix(sendgrid_domain_authentication.default.dns[count.index].host, ".${var.dns_zone_name}")
  resource_group_name = "${data.azurerm_dns_zone.dns_zone.resource_group_name}"
  zone_name           = "${data.azurerm_dns_zone.dns_zone.name}"
  ttl                 = 3600
  record =  "${sendgrid_domain_authentication.default.dns[count.index].data}"
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant