Set allowed and cache methods as non nullable #324
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
Set allowed_methods and cached_methods as non nullable
Setting nullable to false ensures that the variable value will never be null within the module. If nullable is false and the variable has a default value, then Terraform uses the default when a module input argument is null.
why
I want to be able to sometimes call this module with explicit
allowed_methods
andcached_methods
and sometimes just use the module defaults.As it stands, I cannot do that without making my default value match your default value. It would be better for the module to use its defaults when I pass in
null
Right now I am hitting
Which I can work around by setting a default on my side, but it isn't ideal behavior
references
Additional Notes
I wouldn't consider this a breaking change. Today, the behavior if you pass in
null
as the argument to the module you will get a failure as shown above. This makes passing innull
possible without negatively impacting existing users.