Open travis-reed opened 2 months ago
Huh this is interesting @travis-reed -- the first use-case of 'nullable' I've seen. Thanks for providing the explanation!
What version of TF was this introduced? We may need to update our pinning of TF for this module to support this usage depending on when it was added to the language.
/terratest
Huh this is interesting @travis-reed -- the first use-case of 'nullable' I've seen. Thanks for providing the explanation!
What version of TF was this introduced? We may need to update our pinning of TF for this module to support this usage depending on when it was added to the language.
Thanks for taking a look @Gowiem,
This feature was introduced in terraform 1.1
It looks like this module is requiring >= terraform 1.3 so I would expect this to work without upgrading the required version on the module
I see that the bats
action failed, but it seems like that may be failing on older merged prs too.
@coderabbit full review
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@travis-reed the bats error is:
Cloud Posse requires all providers to use registry format introduced in Terraform 0.13, for example
aws = {
source = "hashicorp/aws"
version = ">= 3.0"
}
Please add constraints for these providers:
- local
@CodeRabbit full review
@CodeRabbit full review
/terratest
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.Summary by CodeRabbit
allowed_methods
andcached_methods
by ensuring they cannot be set to null, improving overall data integrity.