terraform
config_error
ai_generated
true
Error: Output refers to sensitive values: output value depends on sensitive attributes
ID: terraform/tf-sensitive-value-output
92%Fix Rate
93%Confidence
70Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1 | active | — | — | — |
Root Cause
An output value references a sensitive attribute without being marked sensitive itself.
genericWorkarounds
-
95% success Mark the output as sensitive = true
Add sensitive = true to the output block: output "name" { value = EXPR; sensitive = true }Sources: https://developer.hashicorp.com/terraform/language/values/outputs
-
80% success Use nonsensitive() only when the value is not actually sensitive (e.g., resource ID derived from sensitive input)
output "id" { value = nonsensitive(resource.example.id) } when the ID itself is not a secretSources: https://developer.hashicorp.com/terraform/language/functions/nonsensitive
Dead Ends
Common approaches that don't work:
-
Use nonsensitive() on actually sensitive values to bypass the check
80% fail
nonsensitive() removes protection from genuinely sensitive data like passwords and keys, exposing them in plan output
-
Remove the sensitive flag from the source variable or resource attribute
85% fail
The upstream provider marks attributes as sensitive for security reasons; this cannot be changed
Error Chain
Preceded by:
Frequently confused with: