TA-002-P · Question #370
A Terraform output that sets the ''sensitive'' argument to true will not store that value in the state file.
The correct answer is B. False. Setting the 'sensitive' argument to true for a Terraform output only prevents its display in CLI output, but the value is still stored unencrypted in the state file.
Question
A Terraform output that sets the ''sensitive'' argument to true will not store that value in the state file.
Options
- ATrue
- BFalse
How the community answered
(45 responses)- A9% (4)
- B91% (41)
Why each option
Setting the 'sensitive' argument to true for a Terraform output only prevents its display in CLI output, but the value is still stored unencrypted in the state file.
This statement is false because the sensitive argument specifically targets CLI output masking, not storage within the state file.
The sensitive = true argument on a Terraform output variable only masks the value from being printed to standard output when terraform plan or terraform apply is run. This setting does not prevent the sensitive value from being stored within the Terraform state file, which can still contain the unencrypted secret.
Concept tested: Terraform output sensitive argument behavior
Source: https://developer.hashicorp.com/terraform/language/values/outputs#sensitive-outputs
Topics
Community Discussion
No community discussion yet for this question.