-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Test whether a value is sensitive #34572
Comments
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again! |
This function can be used to check if a value is marked as sensitive or not within terraform. Closes hashicorp#34572
This function can be used to check if a value is marked as sensitive or not within terraform. Closes hashicorp#34572
This function can be used to check if a value is marked as sensitive or not within terraform. Closes hashicorp#34572
This function can be used to check if a value is marked as sensitive or not within terraform. Closes hashicorp#34572
This function can be used to check if a value is marked as sensitive or not within terraform. Closes hashicorp#34572
This function can be used to check if a value is marked as sensitive or not within terraform. Closes hashicorp#34572
Hi there! @DanielMSchmidt Sadly this branch breaks the ability to check out the source tree on Windows because the doc path has a space at the end.
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Version
Use Cases
I have some submodules
hosts.HOSTNAME
, and want to extract all non-sensitive values from the outputs of these submodules to a non-sensitive output of my rout module, as in the following pseudocode.I need this
hosts_non_sensitive
because I want to useterraform output
andjq
to extract all non-sensitive values from outputs and use them in my NixOS configuration. I use ajq
program like this to extract non-sensitive outputs:Attempted Solutions
Before terraform 1.7.0. I use
can(nonsensitive(output))
to test whether a value is sensitive, and it works perfectly. This solution no longer works after terraform 1.7.0 with #33856.https://github.com/linyinfeng/dotfiles/blob/2ebd6bf740390229f35afed3711f11e6268ccb7f/terraform/hosts.tf#L200-L209
After terraform 1.7.0, this no longer works, since after #33856,
nonsensitive
no longer produces an error when applied to nonsensitive values.The pull request says:
This is wrong because whether an expression produces an error is observable in terraform since the language features a can function:
Proposal
An
issenstive
function.issensitive(e)
evaluatese
, returns true when the value ofe
is sensitive, otherwise returns false.issenstive(_)
should have the same semantics ascan(nonsensitive(_))
(before #33856).Or, a function like
redactsensitive
orstripsensitive
, as proposed in #27812 (comment) and #27812 (comment), which recurses into an object, replace all sensitive values to null.References
The text was updated successfully, but these errors were encountered: