Home › Certifications › Terraform Associate 004 › Providers and Terraform Fundamentals
30 multiple-choice questions and 15 flashcards on Providers and Terraform Fundamentals, about 12% of the Terraform Associate 004 bank. Every one carries a written rationale.
Providers and Terraform Fundamentals is one of 8 chapters in CoStudy's Terraform Associate (004) bank, and it holds 30 of the bank's 250 multiple-choice questions — roughly 12% of the total. That proportion is not arbitrary: chapters follow the certifying body's published exam outline, and the number of questions in each is set by that domain's published weight, so the share of your practice time this chapter takes matches the share of the real exam it accounts for.
Studying by chapter is worth doing once you have a diagnostic score. A single overall percentage tells you whether you are close; it does not tell you which domain is dragging. Working a weak chapter in isolation, and re-testing it in isolation, is the fastest way to move a score that has stalled — and it is why the mock exams in CoStudy report by domain rather than as one number.
10 questions drawn from this chapter, with the full rationale shown — the controlling principle behind the right answer, and why each wrong option tempts and fails.
Conceptually, what is the primary job of Terraform state?
Answer: B — To bind each resource address to the real remote object it represents
B) Correct — state is fundamentally the mapping from configuration addresses to real-world object identities, plus recorded attributes and metadata. A) overstates it: state is a current snapshot with at most a single local backup, not a change history. C) is a persistent misconception; variable values come from files, flags, environment or prompts on each run. D) describes a queued or gated run in a collaboration platform, not the role of the state file.
A reviewer sees a `required_providers` block in a colleague's configuration and asks where it legally belongs. The correct answer is that it must appear:
Answer: D — Nested inside the `terraform` block, which is where provider requirements are declared
D) Correct — `required_providers` is a nested block of the `terraform` settings block. A) is the most common authoring error; a top-level `required_providers` is not valid. B) confuses requirements with configuration: the `provider` block holds settings such as region and credentials, not source and version. C) is wrong on both counts — `backend` configures state storage and is itself nested in the `terraform` block.
A colleague asks what `.terraform.lock.hcl` is actually for. The MOST accurate description is that it:
Answer: A — Records the exact provider versions selected and their checksums so later runs resolve identically
A) Correct — the dependency lock file pins the selected provider versions together with verification hashes, making dependency resolution reproducible. B) describes state locking, an entirely different mechanism provided by the backend. C) confuses the lock file with a saved plan file, which is what captures resolved values. D) also describes a saved plan file produced by `plan -out`.
A configuration pins a provider with `version = "~> 4.16"`. Which set of releases satisfies this constraint?
Answer: A — Any 4.x release at or above 4.16, but nothing in the 5.x series
A) Correct — the pessimistic operator allows the rightmost specified component to increment, so `~> 4.16` permits 4.16 up to but excluding 5.0. B) is the meaning of `~> 4.16.0`, a near-twin constraint with one more component specified. C) describes `>= 4.16`, which deliberately allows major upgrades. D) describes `= 4.16.0`, an exact pin.
A team is evaluating a provider on the public registry and notices providers carry different tier labels. Which statement about those tiers is correct?
Answer: B — Official providers are published and maintained by HashiCorp, while partner providers are maintained by the technology vendor
B) Correct — the tiers distinguish who owns and maintains the code: HashiCorp for official, the vendor for partner, and individuals or groups for community. A) is false: community providers install from the public registry like any other. C) inverts the partner relationship — partner providers are vendor-owned, not HashiCorp forks. D) invents a link between tier and constraint syntax; version constraints work identically for every provider.
What is a Terraform 'provider'?
Answer: D — A plugin that talks to a specific API, turning configuration into calls on that service
D is right: providers are plugins that implement resource and data source types and translate configuration into API calls; they are declared in required_providers and installed by init. A is a module, B is tooling, C is a backend and E is a workspace - all distinct from the plugin layer that actually reaches the platform.
Which block declares a dependency on an external API plugin in Terraform?
Answer: C — provider
Trick: this is the off-by-one block keyword archetype. A 'provider' block configures a plugin (region, credentials). 'resource' declares a managed object; 'module' calls a reusable group; 'output' exposes values.
In the expression provider = aws.west, what is 'aws.west'?
Answer: C — A reference to the aws provider configuration carrying the alias 'west'
C is right: the meta-argument selects which provider configuration a resource or module uses, and the part after the dot is the alias declared on a second provider block. A reads it as a resource address, which uses the same dotted shape and is the natural misread. B invents a module output of a provider. D confuses provider selection with workspaces. Omit the argument and the resource takes the default, unaliased configuration for its type.
A configuration has one `provider "aws"` block with no alias and one with `alias = "dr"`. A resource omits the `provider` meta-argument entirely. Which provider instance configures it?
Answer: B — The block without an alias, which is the default instance for that provider
B) Correct — the block without `alias` is the default configuration, used by every resource of that provider that does not select otherwise. A) is a common worry but false; defining aliases does not make the meta-argument mandatory elsewhere. C) reverses the precedence rule — aliased instances are opt-in only. D) invokes file ordering, which never determines behaviour in Terraform; the language is declarative and order-independent.
What does the constraint `version = ">= 3.0, < 4.0"` instruct Terraform to do?
Answer: B — Accept any release that satisfies both conditions, so 3.x releases only, excluding 4.0 itself
B) Correct — comma-separated constraints are combined with AND, so the allowed window is 3.0 up to but not including 4.0. A) invents fallback behaviour; an unsatisfiable constraint is an error, not a downgrade to something outside the range. C) reads the comma as OR, a frequent misreading. D) is impossible: exactly one version of a given provider is selected per configuration.
4 cards from the 15 in this chapter.
A configuration must create resources in two AWS regions. Explain the mechanism, and say what happens to a resource that omits the provider meta-argument.
You declare a default aws provider block for the first region and a second aws provider block with an alias for the other region, then point specific resources at the alias with provider = aws.<alias>. Any resource that omits the provider meta-argument uses the default, unaliased configuration for that provider type. Aliases are not inherited automatically by child modules — a module must declare the alias in its own configuration_aliases and be passed the provider explicitly.
What does the required_providers block declare, and inside which top-level block does it live?
It declares each provider the configuration needs, giving a local name mapped to a source address and a version constraint. It lives inside the top-level terraform block, for example: terraform { required_providers { aws = { source = "hashicorp/aws", version = "~> 5.0" } } }.
Multiple instances of provider?
Use alias. Example: provider "aws" { alias = "west" region = "us-west-2" }.
Name the Terraform version constraint operators and what each one means.
= or bare version means exactly that version • != excludes a version • > , >= , < , <= compare • ~> is the pessimistic constraint operator, allowing the rightmost specified component to increment only. Multiple constraints can be combined with commas and all must be satisfied.
These are a sample. The full Providers and Terraform Fundamentals chapter runs 45 items with per-chapter progress tracking, on the web and in the iOS app.
Open Terraform Associate 004 in CoStudy →