Bitzu

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

Single choice

Which workflow starts a run automatically when someone pushes a commit to a linked repository?

  1. CLI-driven workflow
  2. VCS-driven workflow
  3. API-driven workflow
  4. 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.

Select all that apply

Which items does an HCP Terraform workspace itself keep?

  1. Variable values, including sensitive ones
  2. A terraform.tfstate file that must live on a laptop
  3. State versions for recovering earlier states
  4. Run history with logs and comments
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More Terraform Associate 004 topics in this module