TF-Associate-004 domain - 11% of the exam

Terraform fundamentals

Terraform fundamentals is 11% of the HashiCorp Certified: Terraform Associate (TF-Associate-004) exam. These are the objectives it covers, each with practice questions, with every answer explained.

Objectives in this domain

Sample question from this domain

Free sampleTerraform fundamentalseasy

A practitioner writes a new configuration that declares an aws_s3_bucket resource but never adds a required_providers entry or a provider block for AWS. They run terraform init in the empty working directory. What does Terraform do about the AWS provider?

resource "aws_s3_bucket" "assets" {
  bucket = "example-assets-bucket"
}
  • AIt infers the provider from the resource type prefix and downloads the hashicorp/aws plugin from the registry during init. Correct
  • BIt fails init immediately because every provider must be pinned in a required_providers block before any plugin can be installed.
  • CIt skips provider installation entirely and defers downloading the plugin until the first terraform apply is run.
  • DIt prompts the practitioner to type the provider source address interactively before continuing the initialisation.
Terraform infers a provider from a resource type prefix and installs the plugin during init even without an explicit required_providers entry. A resource type such as aws_s3_bucket carries the provider local name as its prefix; Terraform resolves that to the default hashicorp/aws source address and installs the plugin during terraform init, which is the phase responsible for provider installation.

Why A is correct: Terraform maps the aws_ prefix to the aws provider, resolves it to the default hashicorp namespace, and installs the plugin during init even without an explicit required_providers entry.

Why B is wrong: Pinning in required_providers is best practice for version control, but its absence does not stop init; Terraform can still infer and install the provider, so this overstates the requirement.

Why C is wrong: Plugin installation is the job of init, not apply; deferring it to apply would leave the working directory uninitialised, so this misplaces when the download happens.

Why D is wrong: Terraform init is non-interactive for provider resolution and infers the source automatically, so it never pauses to ask the user to type a source address.

Other domains in this exam

See also the TF-Associate-004 cert hub, the study guide, and the cheat sheet.

Examworthy is not affiliated with or endorsed by HashiCorp. Original, blueprint-aligned practice material only.