CertLumen

HashiCorp Terraform Associate (004) · Section 2 · 12% of the exam

Describe how Terraform uses providers

One of the objectives of the HashiCorp Certified: Terraform Associate (004) exam, in the section “Terraform fundamentals”. Here is what it covers, the points to remember and a question to try.

What it covers

Providers are the plugins that let Terraform talk to platforms. This lesson covers declaring them with required_providers, source addresses and version constraints, how init and the lock file install them, mirrors and caching, and how to configure several providers or several configurations of one provider, including in modules.

Points to remember

  • Providers are plugin executables; Terraform Core talks to them over RPC and never calls platform APIs itself.
  • The resource type prefix before the first underscore selects the provider unless provider is set.
  • Declare providers in required_providers inside the terraform block; a source is [hostname/]namespace/type and defaults to registry.terraform.io and, when absent, to hashicorp/<local name>.
  • ~> 3.6.0 allows 3.6.x only; ~> 3.6 allows anything from 3.6 up to but excluding 4.0. Reusable modules set a minimum with >= only.
  • terraform init installs providers into .terraform/providers and writes .terraform.lock.hcl; later inits reuse the locked version; init -upgrade moves to the newest allowed.

Try a question

Terraform Core and a provider are related in which way?

  1. AThe provider runs as a separate plugin process that Core calls over RPC
  2. BThe provider stores the state file itself and Core reads it from the provider when needed
  3. CThe provider calls Terraform Core only after the apply finishes
  4. DThe provider is compiled into the terraform binary at install time
Show the answer

A. Providers are separate executables built with the plugin framework. Core sends them requests for validation, planning, reading and applying changes.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Terraform providers: install, version and combine teaches this objective (about 45 minutes), and 28 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 37 objectives · Next objective →