004 · Domain 3: Core Terraform workflow · 13% of the exam
Task 3.1: Describe the Terraform workflow
Write, plan, apply: how an individual, a team and HCP Terraform run the same loop, where review happens, and which command belongs to which step.
Study it
Write, plan, apply for individuals, teams and HCP Terraform
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the HashiCorp documentation page that proves it.
Question 1 · choose 1
An engineer working alone is adding a new subnet to a configuration in a Git repository. Which sequence follows the core Terraform workflow for an individual practitioner?
AApply after every edit to see the result in the cloud, then write a plan at the end of the day for review
BPush the commit, wait for the change to appear in the cloud, then run plan to confirm it
CEdit the configuration and plan repeatedly, apply when the plan looks right, then push the commit
DRun apply first so that state exists, then edit the configuration and plan the difference
Show the answer and why
AApply after every edit to see the result in the cloud, then write a plan at the end of the day for review
Incorrect
Applying each edit changes real infrastructure before any review; plans come before apply.
BPush the commit, wait for the change to appear in the cloud, then run plan to confirm it
Incorrect
Without HCP Terraform or CI connected, pushing a commit does not change any infrastructure.
CEdit the configuration and plan repeatedly, apply when the plan looks right, then push the commit
Correct
Individuals write configuration while running plans as a feedback loop, apply after a final plan review, and then push their repository to a remote.
DRun apply first so that state exists, then edit the configuration and plan the difference
Incorrect
An apply of an unedited configuration changes nothing useful; the loop starts with writing.
Write, plan, apply: the plan is both the feedback loop while writing and the final check before apply.
Several engineers edit the same configuration at the same time. In the team version of the write step, how do they avoid colliding with each other's work?
AThey take turns holding the state lock while they edit files
BThey work in version control branches and merge later
CEach engineer keeps a private copy of the state to apply from
DThey edit only in the main branch and run apply after each save
Show the answer and why
AThey take turns holding the state lock while they edit files
Incorrect
State locks protect state during operations, not editing of files.
BThey work in version control branches and merge later
Correct
Team members save changes to version control branches to avoid collisions and resolve incompatible changes when merging.
CEach engineer keeps a private copy of the state to apply from
Incorrect
Private state copies lead to conflicting views of the infrastructure.
DThey edit only in the main branch and run apply after each save
Incorrect
Applying unreviewed edits defeats the team workflow.
Teams write configuration the way they write code: branches first, merges later.