Chapter 4 of 7 · HashiCorp Terraform Infrastructure Engineer Professional

CI/CD and Automation Workflows

CI/CD for Terraform Professional (002): pipeline stages and exit codes, safe deployment, dynamic provider credentials and variable override order.

  • 2topics
  • 10 minfast track
  • 1diagrams and exhibits

Topics in this chapter

Take them in order, or jump to the one you need.

  1. 1Pipelines and Deployment StrategiesTerraform Professional 002: run Terraform in CI, use detailed exit codes and saved plans, handle locks and plugin caches, and…Diagram5 min
  2. 2Dynamic Credentials and Variable OverridesTerraform Professional 002: share dynamic provider credentials across teams and workspaces, scope OIDC trust, and predict which…5 min

About this chapter

What this chapter covers

CI/CD and automation workflows covers running Terraform with no person at the keyboard. You build a pipeline that plans, waits for approval and applies, choose how changes roll out, give each run short-lived credentials, and control which variable value wins.

Questions are single-answer and multiple-answer ("Pick the 2 correct responses below") multiple choice, mostly scenarios and configuration to read. There are no exhibits.

How the topics fit together

Pipelineinit, plan, approve, applyDeployment strategylocks, caching, traffic shiftDynamic credentialsone identity per runVariable overrideswhich value wins

The pipeline is the frame. Everything else answers a question it raises: how to keep runs from colliding, what identity they use, and where their values come from.

  • Pipeline questions ask about exit codes, saved plans, environment variables and pull request plans.
  • Deployment strategy questions ask about lock behavior, the CLI configuration file, plugin caching, and blue-green or canary rollouts.
  • Credential questions ask which variables to set, how to scope trust, and how to run several configurations of one provider.
  • Variable questions give several sources for one value and ask which one Terraform uses.
Exam tip

For variable questions, list every source in the scenario, then apply the order from the bottom up. Most wrong answers come from assuming terraform.tfvars beats *.auto.tfvars, when the auto files win.

How to use these pages

Each topic page has the same shape, so you can skim for what you need.

  • What it is: the idea in plain words.
  • How it works: the mechanism, with tables and examples.
  • What to remember for the exam: the facts to memorize and how questions are phrased.
  • Common mistakes: the classic traps.
  • Check yourself: three questions to test your understanding.

Ready for more practice?

The full HashiCorp Terraform Infrastructure Engineer Professional question bank has 600 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by HashiCorp. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.