Answering Terraform Associate Questions
Terraform Associate questions are short and direct, but each format has its own traps. This lesson explains how to approach true/false, multiple choice, multiple answer and code-reading questions.
Learning outcomes
After completing this lesson, you will be able to:
- Apply a method for true/false, multiple choice and multiple answer questions.
- Identify common distractors in code-reading questions.
What the questions test
HashiCorp states that the questions are not intended to trick candidates and that they test knowledge of Terraform, not spelling or obscure details. Most questions test one of three things: what a command or block does, what Terraform does in a given situation, or which approach is recommended. The best preparation is to know default behaviour precisely, because many distractors describe what a reasonable tool might do rather than what Terraform does.
For example, a question might ask which commands refresh state automatically. Many candidates know that plan and apply refresh, but distractors such as terraform validate and terraform output sound plausible unless you know that validate never contacts remote services and output only reads the latest state.
True or false questions
A true or false question presents one statement. Read every word, because a single qualifier decides the answer. Statements with absolutes such as "always", "never" or "only" are false if one exception exists; statements about defaults are true only if no flag or setting is mentioned. Consider "Marking a variable as sensitive prevents its value from being stored in state." The first half sounds right, but sensitive values are stored in state in plain text, so the statement is false.
Read every word
Multiple choice and multiple answer questions
Multiple choice questions have one correct answer. Multiple answer questions say how many to select, such as "Pick the 2 correct responses", and are scored as a whole, so each option must be judged on its own as true or false for the scenario. The following steps work for both.
-
Find the decisive detail
Identify the command, block, flag or setting the question depends on, such as a saved plan file or a VCS connection.
-
Recall the default
State what Terraform does by default in that situation before reading the options.
-
Judge each option independently
Mark each option true or false; for multiple answer questions, count that you have exactly the number requested.
-
Check combined options
Options such as "All of the above" or "None of the above" are correct only if every listed option is, or none is.
HashiCorp's own sample questions include an "All of the above" answer: both terraform plan and terraform plan -var-file=terraform.tfvars use the values in terraform.tfvars, because the file is loaded automatically and naming it explicitly is also allowed.
Code-reading questions
Some questions show a configuration snippet and ask for a reference, a result or a missing value. Read the types first: a variable of type map is indexed by key, as in var.vpc_cidrs["us-east-1"], while a list is indexed by number. Check the prefixes: variables need var., data sources need data., locals use local. (singular) and module outputs use module.NAME.OUTPUT. Options that drop a prefix or index a map by position are common distractors.
Reading the snippet
A multiple answer question
Which TWO actions happen when you run terraform apply without a plan file? Options: Terraform installs the required providers; Terraform shows a plan and waits for approval; Terraform reformats the configuration; Terraform updates state with the changes it makes; Terraform destroys and recreates all resources.
Without a plan file, apply creates a new plan, shows it and waits for yes, so the second option is correct. As each change completes, Terraform records it in state, so the fourth option is correct. Installing providers is the job of terraform init; formatting is terraform fmt; and apply changes only what the plan requires, so recreating everything is wrong. Exactly two options remain, which matches the question.
Is the statement "terraform validate refreshes state before checking the configuration" true or false?
Show answer
False. validate never reads state or calls provider APIs; only plan and apply refresh by default.
Exam Tips
Remember for the exam
- Know defaults exactly; distractors describe plausible but wrong behaviour.
- In true/false questions, one wrong clause makes the statement false.
- Multiple answer questions state how many to pick; judge every option on its own.
- Check prefixes and index types in code-reading questions.