Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 267


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

Show Answer
Correct Answer: A

Editing the state file directly before running terraform apply is not considered a safe way to inject sensitive values into a Terraform Cloud workspace. Modifying the state file directly can lead to corruption and unpredictable behavior in your infrastructure management. Using the -var flag on the command line or specifying a variable file with the -var-file flag are more controlled and conventional methods of injecting values.

Discussion

7 comments
Sign in to comment
VSMuOption: A
Jul 21, 2023

Choosing A as it is not right way to do it. Even though C is not preferred, I think you can do it as you are supplying it as a parameter during run and the file is local to the operator running the command and hence can delete it after that. Since we are talking about state being stored remotely, it works very much similar to option B.

ShakDaddy
Jul 31, 2023

A is not possible at all. The question is regarding which is “NOT” the safe way. By interpretation meaning possible but not recommended. The answer is suggests C.

AWS_cert2023
Jun 22, 2023

The answer C. A is wrong for Terraform state, don't recommend to edit state file.

DevoteamAnalytix
Jun 26, 2023

I agree, A is nonsense and B is a favored way, so C is the bad one

biprodattaOption: C
Jul 15, 2023

putting sensitive information in file and using that file whole terraform run is not a safe way !

090200fOption: C
Aug 3, 2024

even I think C is more sense to me, https://developer.hashicorp.com/terraform/tutorials/configuration-language/sensitive-variables

nmnm22Option: C
Aug 8, 2024

A doesnt even make sense given our context, this is a question about sensitive data, nothing to do with corrupted state files

bora4motionOption: C
Aug 15, 2024

C makes more sens than A.

sco_muradOption: A
Oct 21, 2024

no direct state file modification!