github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/sensitive.mdx (about)

     1  ---
     2  page_title: sensitive - Functions - Configuration Language
     3  description: The sensitive function marks a value as being sensitive.
     4  ---
     5  
     6  # `sensitive` Function
     7  
     8  -> **Note:** This function is only available in Terraform v0.15 and later.
     9  
    10  `sensitive` takes any value and returns a copy of it marked so that Terraform
    11  will treat it as sensitive, with the same meaning and behavior as for
    12  [sensitive input variables](/language/values/variables#suppressing-values-in-cli-output).
    13  
    14  Wherever possible we recommend marking your input variable and/or output value
    15  declarations as sensitive directly, instead of using this function, because in
    16  that case you can be sure that there is no way to refer to those values without
    17  Terraform automatically considering them as sensitive.
    18  
    19  The `sensitive` function might be useful in some less-common situations where a
    20  sensitive value arises from a definition _within_ your module, such as if you've
    21  loaded sensitive data from a file on disk as part of your configuration:
    22  
    23  ```
    24  locals {
    25    sensitive_content = sensitive(file("${path.module}/sensitive.txt"))
    26  }
    27  ```
    28  
    29  However, we generally don't recommend writing sensitive values directly within
    30  your module any of the files you distribute statically as part of that module,
    31  because they may be exposed in other ways outside of Terraform's control.
    32  
    33  ## Examples
    34  
    35  ```
    36  > sensitive(1)
    37  (sensitive)
    38  > sensitive("hello")
    39  (sensitive)
    40  > sensitive([])
    41  (sensitive)
    42  ```