Merge pull request #27280 from hashicorp/pselle/docs-sensitive-var

(docs) Document sensitivity + function call behavior
This commit is contained in:
Pam Selle 2020-12-15 11:46:30 -05:00 committed by GitHub
commit 6bfc4a8809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -48,6 +48,26 @@ min([55, 2453, 2]...)
The expansion symbol is three periods (`...`), not a Unicode ellipsis character
(`…`). Expansion is a special syntax that is only available in function calls.
## Using Sensitive Data as Function Arguments
When using sensitive data, such as [an input variable](https://www.terraform.io/docs/configuration/variables.html#suppressing-values-in-cli-output)
or [an output defined](https://www.terraform.io/docs/configuration/outputs.html#sensitive-suppressing-values-in-cli-output) as sensitive
as function arguments, the result of the function call will be marked as sensitive.
This is a conservative behavior that is true irrespective of the function being
called. For example, passing an object containing a sensitive input variable to
the `keys()` function will result in a list that is sensitive:
```shell
> local.baz
{
"a" = (sensitive)
"b" = "dog"
}
> keys(local.baz)
(sensitive)
```
## When Terraform Calls Functions
Most of Terraform's built-in functions are, in programming language terms,