HashiCorp Certified: Terraform Associate — Question 326

Which of the following is the safest way to inject sensitive values into a Terraform Cloud workspace?

Answer options

Correct answer: B

Explanation

The correct answer is B because marking a variable as 'Sensitive' in the UI ensures that its value is encrypted and not displayed in logs. Option A may expose sensitive data if the file is not handled securely, option C is risky as directly editing the state file can lead to corruption, and option D does not provide any protection for sensitive values as they will be visible in command-line history.