Closed YakobovLior closed 2 years ago
Hi Lior,
Are you using Terragrunt with this module or plain Terraform?
It seems that your question is about the general usage of Terraform, specifically for
expressions should give you some information about how to generate lists or maps.
Please ask general Terraform questions on discuss.hashicorp.com.
Hey @antonbabenko, I am using Terragrunt alongside with Terraform, does it matter in some way?
The question is does this module supports the desired behavior I mentioned above.
Thanks, Lior
Yes, the module supports multiple node_groups. See this example.
You can have two variables, the temporary one with a boolean, and the final one as a for if loop on the first one that only copies the element when the special boolean is true
Hey @antonbabenko , @jaimehrubiks I managed to solve my issue with the use of locals, I will describe here as it might help someone in the future.
I have defined 3 locals, whereas every local has different values based on the conditions I have, and then a fourth local which equals to one of the previous 3 based on the conditions. And eventually I use the fourth local as the value for node_groups in the module.
Thanks for the help, Lior
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Versions
Description
I'm looking for the ability to configure multiple nodegroups, but actually create them conditionally based on variables. Here is a snippet from my configuration:
node_groups list includes more than one nodegroup of course, and I want to manage the creation of the different nodegroups based on variables. Seems that count as part of the nodegroup configuration is not supported. Is there any other way that I can achieve my goal?
Thanks, Lior