-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unable to use for_each to create multiple clusters at once: nested provider configuration for "kubernetes" #673
Comments
Hi @BundyQ @morgante as the recommended approach from 0.11 is this, what are your thoughts on making |
I'd like to avoid it if possible, as it introduces additional complexity for users and wiring them together is non-trivial. |
I think there are two options: ii) Submodule approach where we get necessary info using the From an end user perspective both are pretty big changes os happy to discuss further if anyone has other ideas. |
Hi, Terraform 13 suggests the following: I still don't get how you can bypass this with the given message. When you say you remove the provider block @bohdanyurov-gl you mean in the local modules? |
I had the same frustration with provider & count limitations when creating clusters and instances within an aurora global db, but it seems to be the direction Terraform is going: hashicorp/terraform#25120 (comment) |
Yes. Remove provider block on your local modules |
How do you plan to do this with Kubernetes ?
The provider needs arguments (such as host) from resources created in the module. |
@thecodeassassin I'm facing the same issue as you. Any luck at the end? |
@alvis Well didn't succeed. So basically I'm stuck copy pasting modules :( |
I am sorry if this issue has been discussed before but I couldn't find anything about it.
We are currently trying to create multiple clusters at once using terraform's for_each. The idea behind this was to use terraform-google-modules/project-factory to create projects for different environments (dev, stg, prd, ...) and afterwards create the same resources for each project. Unfortunately when we try call the GKE module with for_each like:
where
each.key
is the name of the environment andeach.value
the newly created project id. We get the error:Are we doing something wrong or is for_each simply not supported (yet)?
The text was updated successfully, but these errors were encountered: