Terraform Associate 004 ยท HCP Terraform
Creating infrastructure with HCP Terraform
Remote runs, VCS-driven, CLI-driven and API-driven workflows, run stages (plan, policy check, apply), remote state storage (8a).
Key points
- A workspace holds configuration, variables, state and run history.
- Runs start from a linked VCS repository, from the CLI (cloud block) or through the API.
- By default they execute remotely on HCP Terraform's own VMs, and state is stored in the workspace with earlier versions kept.
Source: https://developer.hashicorp.com/terraform/cloud-docs/workspaces
Practice questions
Which workflow starts a run automatically when someone pushes a commit to a linked repository?
- CLI-driven workflow
- VCS-driven workflow
- API-driven workflow
- Local-only workflow
Show answer
Answer: B. VCS-driven workflow
The VCS-driven workflow watches the connected repository and queues a run on changes. CLI-driven runs begin from a terminal command, and API-driven runs from an HTTP call.
Which items does an HCP Terraform workspace itself keep?
- Variable values, including sensitive ones
- A terraform.tfstate file that must live on a laptop
- State versions for recovering earlier states
- Run history with logs and comments
- Your cloud provider's compiled binaries
Show answer
Answer: A. Variable values, including sensitive ones, C. State versions for recovering earlier states, D. Run history with logs and comments
A workspace stores variable values, the state with its earlier versions, and the run history. It does not depend on a state file on your laptop, and the provider binaries are not what it stores.
In a VCS-driven workflow, someone must run terraform apply on their own machine to start each run.
Show answer
Answer: False
False. The linked repository triggers runs, so no local terraform command is needed to start them.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
