Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 160


A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.

Show Answer
Correct Answer: B

A Terraform output that sets the 'sensitive' argument to true will still store that value in the state file. The 'sensitive' argument is used to prevent the sensitive value from being displayed in plain text in the Terraform CLI output, Terraform Cloud UI, and other user interfaces. However, the value will still be present in the state file in cleartext, accessible to anyone with permissions to view the state file. Proper security practices, such as role-based access control and data encryption, should be implemented to mitigate this risk.

Discussion

8 comments
Sign in to comment
BurakkoOption: B
Mar 2, 2024

"Terraform will still record sensitive values in the state, and so anyone who can access the state data will have access to the sensitive values in cleartext."

campsOption: B
Sep 30, 2024

B. False. A Terraform output that sets the "sensitive" argument to true will still store that value in the state file. The "sensitive" argument is used to prevent the value from being displayed in plain text in the Terraform CLI output, Terraform Cloud UI, and other locations where output values may be displayed. However, the value will still be stored in the Terraform state file, which is used to track the current state of the infrastructure. It is important to be aware that while the "sensitive" argument can help to prevent accidental exposure of sensitive values, it is not a substitute for proper security practices such as role-based access control and data encryption.

depal_dhirOption: B
Mar 7, 2024

https://www.terraform.io/language/values/outputs

Hizumi
Mar 5, 2024

Answer is B. Reference: https://www.terraform.io/language/values/outputs

G4ExamsOption: B
May 1, 2024

When we mark something as sensitive in the configuration then it's hidden from the CLI for example when an output is set. But it will still be plain text in the state file.

nakikooOption: B
Jun 16, 2024

it still store in statefile, but is hidden for security when accessing provider information that requires sensitive information such as credentials

Loopjoke
Aug 3, 2024

Y’all wrong. Answer A and ChatGPT has as True as well.

lezgino
Aug 5, 2024

The answer is B. ChatGPT also can say wrong anwer. It should learn first)

Bilalglg93350
Sep 14, 2024

This statement is true. When you set the sensitive argument to true in a Terraform output, the output value will not be shown in plain text in the Terraform state file or in Terraform command output. This is useful for sensitive information such as passwords, keys, or other secrets. While the value of the output is still stored in the state file, it is stored in a hashed format that is not easily readable. Additionally, the value will not be shown in plain text when running the terraform output command or when viewing the state file. Setting the sensitive argument to true in a Terraform output can help prevent sensitive information from being accidentally exposed or leaked.