-
Notifications
You must be signed in to change notification settings - Fork 982
Cloud NAT module variable required but should be optional #2140
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
Comments
One thing to note, is that you could just have |
@ghacrow thanks for the detailed feedback, and for coming up with a potential solution!
Good point, but I wouldn't add validation that the provider itself is already doing
...or set is to Would you mind sending a PR with your proposed solution? |
@sruffilli Hey - yeah of course. I will try and find some time later this week / next week to get this together alongside documentation updates. Good point about using |
Describe the bug
In the
net-cloudnat
module, the variablesubnetworks
has a required secondary_ranges input. However, this is an optional input (see terraform docs here) as is only required should you useLIST_OF_SECONDARY_IP_RANGES
in theconfig_source_ranges
input of thesubnetworks
variable.E.g., if I want to use
ALL_IP_RANGES
inconfig_source_ranges
, I would not have anything to enter in thesecondary_ranges
, but this stops me from using the module.Environment
To Reproduce
Try using the cloud NAT module with the above config, e.g.,
Expected behavior
Be able to create a Cloud NAT and Router
Result
Additional context
I think the solution is just to add
optional()
around the code e.g.,However, you may wish to make this check a little more complex, having it required if the
config_source_ranges
is a value such that thesecondary_ranges
are requiredThe text was updated successfully, but these errors were encountered: