The AWS provider recently implemented a resource which included a boolean argument that should only ever be null or true. To enforce this condition, we added a custom BoolEquals validator that confirms a non-null boolean value exactly matches that which the validator is configured with (in our case true).
I'm not sure if this use case is a common enough to warrant moving up into this repository, but thought I'd offer up our implementation just in case.
Proposal
Add a new Equals validator to the boolvalidator package.
Terraform CLI and Framework Versions
Use Cases or Problem Statement
The AWS provider recently implemented a resource which included a boolean argument that should only ever be
null
ortrue
. To enforce this condition, we added a customBoolEquals
validator that confirms a non-null boolean value exactly matches that which the validator is configured with (in our casetrue
).I'm not sure if this use case is a common enough to warrant moving up into this repository, but thought I'd offer up our implementation just in case.
Proposal
Add a new
Equals
validator to theboolvalidator
package.Additional Information
The AWS provider implemented a custom version of this in a recent pull request: https://github.com/hashicorp/terraform-provider-aws/pull/39180
Code of Conduct