Skip to content
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

Feature Request - List of Domains in gandi_nameservers #131

Open
AshleyJackson opened this issue Oct 26, 2022 · 1 comment
Open

Feature Request - List of Domains in gandi_nameservers #131

AshleyJackson opened this issue Oct 26, 2022 · 1 comment

Comments

@AshleyJackson
Copy link

A company with a wide range of domains may want to use a list of domains under the "gandi_nameservers" list to change name servers, instead of each domain having their own "gandi_nameservers" resource.

As we can no longer specify nameservers in gandi_domain, I believe this feature would be very useful.

The current design disallows a list and requires a string

Inappropriate value for attribute "domain": string required.

An Example of a potential working state:

resource "gandi_nameservers" "gandi" {
  domains = [
    "gandiExample1.com",
    "gandiExample2.co.uk"
  ]
  nameservers = [
    "ns-31-a.gandi.net",
    "ns-84-b.gandi.net",
    "ns-200-c.gandi.net",
  ]
}

resource "gandi_nameservers" "cloudflare" {
  domains = [
    "CloudFlareExample3.com",
    "CloudFlareExample4.co.uk"
  ]
  nameservers = [
    "eva.ns.cloudflare.com",
    "pete.ns.cloudflare.com"
  ]
}

Thanks.

@ojacobson
Copy link

Would something like this work? Terraform supports mapping resource instances to sets of values out of the box.

resource "gandi_nameservers" "gandi" {
  for_each = toset([
    "gandiExample1.com",
    "gandiExample2.co.uk",
  ])

  domain = each.key
  nameservers = [
    "ns-31-a.gandi.net",
    "ns-84-b.gandi.net",
    "ns-200-c.gandi.net",
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants