Skip to content

Add option to set TTL for the DNS records created by google_dns_managed_zone #5280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
natarajaya opened this issue Dec 30, 2019 · 4 comments
Closed
Labels
enhancement forward/review In review; remove label to forward service/cloud-dns

Comments

@natarajaya
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Seems like currently there is no way to set TTL for the NS and SOA records created by google_dns_managed_zone. TTL is always set to default value (21600 seconds) for both records.

New or Affected Resource(s)

  • google_dns_managed_zone

Potential Terraform Configuration

# Resource below will create 2 records (NS and SOA) in Cloud DNS.
# Currently resource configuration does not allow to set TTL for these records.

resource "google_dns_managed_zone" "root_zone" {
  name        = "${replace(var.organization_domain, ".", "-")}"
  dns_name    = "${var.organization_domain}."
  description = "root ${var.organization_domain} DNS zone"

  lifecycle {
    prevent_destroy = "true"
  }
}
@ghost ghost added the enhancement label Dec 30, 2019
@danawillow
Copy link
Contributor

The ManagedZone API doesn't have a ttl attribute unfortunately, so this isn't a trivial change (https://cloud.google.com/dns/docs/reference/v1/managedZones). However, we do have the ability to change ttl on record sets that are managed by Terraform using the ttl attribute on google_dns_record_set. For this particular resource, the provider will override existing entries (rather than complaining that it already exists), so if you're willing to manage the NS and SOA records using Terraform, then you can add resources for them and it'll work. Does that work for your use case?

@natarajaya
Copy link
Author

@danawillow Yes, to workaround this, we decided to override entries created by google_dns_managed_zone with google_dns_record_set resources to set proper TTL, and it seems to do the trick!

@ghost ghost removed the waiting-response label Jan 2, 2020
@danawillow
Copy link
Contributor

Glad it worked! Going to close this out since the workaround seems like a reasonable one going forward.

@ghost
Copy link

ghost commented Feb 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Feb 2, 2020
@github-actions github-actions bot added forward/review In review; remove label to forward service/cloud-dns labels Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement forward/review In review; remove label to forward service/cloud-dns
Projects
None yet
Development

No branches or pull requests

2 participants