Task 8.1: Use HCP Terraform to create infrastructure
Remote runs in HCP Terraform: the VCS-driven, CLI-driven and API-driven workflows, workspace variables, run stages and states, and where the state is kept.
Study it
Runs in HCP Terraform: VCS, CLI and API workflows, variables and run stages
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
A workspace is connected to the main branch of a GitHub repository and uses manual apply. A pull request is merged into main. What happens in HCP Terraform?
ANothing, until an engineer runs terraform apply from a laptop against the workspace
BThe plan from the pull request is applied at once, without a new plan
CA run is queued, and its plan waits for an authorized user to confirm
DA run is queued for every branch in the repository, including the merged one
Show the answer and why
ANothing, until an engineer runs terraform apply from a laptop against the workspace
Incorrect
VCS-connected workspaces start runs from webhooks on the linked branch.
BThe plan from the pull request is applied at once, without a new plan
Incorrect
The merge starts a new run that plans the merged commit on its own.
CA run is queued, and its plan waits for an authorized user to confirm
Correct
In the VCS workflow, commits to the linked branch queue runs automatically; with manual apply, a user with permission must confirm the plan.
DA run is queued for every branch in the repository, including the merged one
Incorrect
A workspace follows one branch and ignores changes to others.
VCS-driven: a merge queues a run, and with manual apply an authorized person reviews the plan and confirms it.