Chapter 2 of 8 · HashiCorp Terraform Associate 004

Terraform Fundamentals

Installing and versioning providers, multiple providers and state.

  • 2topics
  • 10 minfast track

Topics in this chapter

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

  1. 1Installing, Versioning and Using ProvidersTerraform Associate (004): required_providers, version constraints, the dependency lock file, how providers work, and multiple…5 min
  2. 2How Terraform Uses and Manages StateTerraform Associate (004): what the state file stores, why Terraform needs state, refresh and drift, backups, and keeping secrets…5 min

About this chapter

What this chapter covers

Terraform fundamentals covers the two building blocks every Terraform run depends on: providers and state. Providers are the plugins that talk to each platform, and state is the record of what Terraform manages.

The chapter has two parts: installing, versioning and using providers, including configurations with several providers and provider aliases, then how Terraform uses and manages state.

Questions are single-answer, multiple-answer ("Pick the 2 correct responses below") and true or false statements, mostly direct recall of commands and behavior plus short HCL snippets that open "Consider the following configuration snippet:". There are no exhibits.

How the topics fit together

required_providerssource and versionterraform initProviders installedlock file writtenPlan and applyproviders call APIsStatewhat Terraform manages

You declare which providers you need and which versions are allowed. Terraform installs them and records the exact versions, the providers make the API calls, and state maps every resource in your configuration to the real object it created.

  • Provider install questions ask about required_providers, version constraints and the dependency lock file.
  • Provider use questions ask what a provider does and how a resource is linked to one.
  • Multiple provider questions ask about aliases, the provider meta-argument and passing providers to modules.
  • State questions ask what state stores, why Terraform needs it and how it should be protected.
Exam tip

Version constraints live in required_providers, exact selected versions live in .terraform.lock.hcl. Questions about "why did init not pick the newer version" almost always point to the lock file and terraform init -upgrade.

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 Associate 004 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.