Rationale for Correct Answer: Marking a variable (or output) as sensitive = true primarily prevents Terraform from displaying the value in CLI output and in some UI contexts. It does not prevent the value from being stored in the state file if that value is used by resources. Terraform state must often store attribute values to track and manage infrastructure; sensitive marking is about redaction, not state omission.
Analysis of Incorrect Options (Distractors):
A (True): Incorrect—sensitive values can still be written to state; you must protect state storage (encryption, access control) and avoid storing secrets in state where possible.
Key Concept: Sensitive values are redacted in output, but still can exist in state.
[Reference: Terraform Objectives — Implement and Maintain State (state contents and sensitive data handling), Read, Generate, and Modify Configurations (sensitive variables/outputs)., , ]
Submit