Question 650
A Terraform associate evaluates: A security engineer asks how to collect logs without keeping secrets in long-term shared build output. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: A security engineer asks how to collect logs without keeping secrets in long-term shared build output. The directly relevant Terraform response is: Set TF_LOG together with TF_LOG_PATH to capture troubleshooting output in a protected file and remove it after authorized review. This addresses the related failure mode: Logs containing resource attributes and credentials should not be committed to Git or left in public CI artifacts. Validate the result by checking: The designated log file captures the relevant run and is stored under approved short-lived restricted access. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: A security engineer asks how to collect logs without keeping secrets in long-term shared build output. The acceptance evidence is: The designated log file captures the relevant run and is stored under approved short-lived restricted access. It verifies the corrective approach (Set TF_LOG together with TF_LOG_PATH to capture troubleshooting output in a protected file and remove it after authorized review.) and controls the risk: Logs containing resource attributes and credentials should not be committed to Git or left in public CI artifacts. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
The listed address matches the intended resource and show presents its recorded attributes for review. This belongs to Inspect state list and show (official objective 7b). Its separate risk is that guessing resource bindings from cloud consoles without inspecting state can target the wrong Terraform address. The question instead tests TF_LOG_PATH debug log file handling; that other safeguard alone does not verify it.
Removing a binding when intending only a resource rename can cause Terraform to plan duplicate resources. This is relevant to State mv versus state rm and moved blocks (official objective 7b). Its distinct failure risk is that removing a binding when intending only a resource rename can cause Terraform to plan duplicate resources. The present question tests TF_LOG_PATH debug log file handling, which this measure alone does not establish.
Set TF_LOG to an appropriate supported level such as DEBUG or TRACE only while investigating, then disable it afterward. This does not provide the required TF_LOG_PATH debug log file handling action-and-evidence pair.