Skip to content
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

Equals validator for boolean types #231

Closed
1 task done
jar-b opened this issue Sep 18, 2024 · 0 comments · Fixed by #232
Closed
1 task done

Equals validator for boolean types #231

jar-b opened this issue Sep 18, 2024 · 0 comments · Fixed by #232
Labels
enhancement New feature or request
Milestone

Comments

@jar-b
Copy link
Member

jar-b commented Sep 18, 2024

Terraform CLI and Framework Versions

% terraform version
Terraform v1.9.5
on darwin_arm64
% cat go.mod | rg terraform-plugin-framework
        github.com/hashicorp/terraform-plugin-framework v1.11.0
        github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0
        github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1
        github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0
        github.com/hashicorp/terraform-plugin-framework-validators v0.13.0

Use Cases or Problem Statement

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.

Additional Information

The AWS provider implemented a custom version of this in a recent pull request:
hashicorp/terraform-provider-aws#39180

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jar-b jar-b added the enhancement New feature or request label Sep 18, 2024
@austinvalle austinvalle added this to the v0.14.0 milestone Sep 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants