Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 00h 00m 00s Coupon code: 50OFF
Free Exam Questions

Terraform-Associate-004 Exam Questions & Answers

HashiCorp Certified: Terraform Associate (004)  •  HashiCorp

359 Questions Updated Sep 2026 99% Pass Rate
Get Full Access

100% money-back guarantee

Sample Terraform-Associate-004 Questions

Practice with real exam-style questions, each with the verified correct answer and explanation.

Q1 MultipleChoice

A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?

Correct Answer: B
Explanation:

In Terraform, the correct way to reference a resource attribute is:

pgsql

CopyEdit

resource_type.resource_name.attribute

For example, if the resource block is:

hcl

CopyEdit

resource 'kubernetes_namespace' 'example' {

metadata {

name = 'my-namespace'

}

}

To reference the name attribute, use:

pgsql

CopyEdit

kubernetes_namespace.example.name

Explanation of incorrect answers:

A (resource.kubernetes_namespace.example.name)-- Incorrect. Terraform does not use the resource. prefix when referencing resources.

C (data.kubernetes.namespace.name)-- Incorrect. This syntax is used fordata sources, not resources.

D (kubernetes_namespace.test.name)-- Incorrect. The resource name is 'example', not 'test'.

Official Terraform Documentation Reference:

Terraform Resource Reference

Q2 MultipleChoice

What kind of configuration block will create an infrastructure object with settings specified within the block?

Correct Answer: D
Explanation:

This is the kind of configuration block that will create an infrastructure object with settings specified within the block. The other options are not used for creating infrastructure objects, but for configuring providers, accessing state data, or querying data sources.

Q3 MultipleChoice

You have just developed a new Terraform configuration for two virtual machines with a cloud provider. You would like to create the infrastructure for the first time.

Which Terraform command should you runfirst?

Correct Answer: B
Explanation:

B (terraform init)--Must be run firstto initialize the Terraform working directory, download providers, and configure the backend.

A (terraform apply)-- Requires initialization first, so itcannotbe run before terraform init.

C (terraform plan)-- Also requires terraform init first to generate a plan.

D (terraform show)-- Displays the state,not relevantfor first-time deployment.

Official Terraform Documentation Reference:

terraform init - HashiCorp Documentation

Q4 MultipleChoice

The terraform output command shows outputs from child modules.

Correct Answer: B
Explanation:

Rationale for Correct Answer: terraform output shows the root module's outputs (the outputs defined in the current working directory's root module). Outputs from child modules are not directly listed unless the root module re-exports them via its own output blocks (e.g., output 'child_public_ip' { value = module.child.public_ip }).

Analysis of Incorrect Options (Distractors):

A (True): Incorrect because child module outputs are accessible via module.<name>.<output>, but terraform output displays only outputs defined in the root module.

Key Concept: Module outputs scope: child outputs must be exposed through root outputs to be shown by terraform output.

Q5 MultipleChoice

Exhibit:

provider "aws" { region = "us-east-1" }

provider "aws" { region = "us-west-2" }

You need to deploy resources into two different AWS regions in the same Terraform configuration using the provider blocks shown in the exhibit. What do you need to add to the provider configuration to deploy a resource to the us-west-2 AWS region?

Correct Answer: A
Explanation:

Detailed

Rationale for Correct Answe r:Terraform requires provider aliases when you configure the same provider multiple times in one configuration. You must define the second AWS provider with an alias, then explicitly tell the resource to use it with the provider meta-argument:

provider 'aws' {

region = 'us-east-1'

}

provider 'aws' {

alias = 'west'

region = 'us-west-2'

}

resource 'aws_instance' 'example_us_west_2' {

provider = aws.west

ami = data.aws_ami.ubuntu.id

instance_type = 't3.micro'

}

This is a core Terraform objective: selecting the correct provider configuration for a resource when multiple instances exist.

Analysis of Incorrect Options (Distractors):

B: Incorrect. Provider blocks do not support the syntax provider 'aws' 'west' { ... }. Aliasing is done with alias = 'west'.

C: Incorrect. You cannot invent a new provider type name like aws_west. The provider remains aws; you differentiate configurations via alias.

D: Incorrect. Terraform will not automatically choose between multiple provider configurations for the same provider; you must disambiguate using aliases and provider = ....

Key Concept:Provider aliases and the provider meta-argument for multi-region (or multi-account) deployments.

Get access to all 359 verified questions with detailed answers.

Unlock All Terraform-Associate-004 Questions

Frequently Asked Questions

The exam covers five main domains: understand infrastructure as code concepts, understand Terraform's purpose and benefits, interact with Terraform modules, navigate Terraform workflow, and implement and maintain state. You should be familiar with Terraform configuration syntax, state management, modules, workspaces, and basic CLI commands.

The exam is 60 minutes long and consists of multiple-choice and multiple-select questions. You need to pass with a score of 70% or higher to earn the certification.

The exam costs $70.50 USD. HashiCorp occasionally offers free exam vouchers through training courses, webinars, or special promotions, so it's worth checking their website for current offers.

While hands-on experience is highly recommended, it's not strictly required. However, most candidates find that practical experience with Terraform, such as writing configurations and managing state, significantly improves their ability to pass the exam and understand real-world scenarios.

HashiCorp provides official study materials including the Terraform documentation, free online tutorials, and a study guide specific to exam objectives. Many candidates also use third-party study guides, practice exams, and YouTube tutorials to supplement their preparation.
Exam Details
  • Exam CodeTerraform-Associate-004
  • VendorHashiCorp
  • Total Questions359
  • LanguageEnglish
  • Last UpdatedSep 4, 2026
4.9/5

Pass Terraform-Associate-004 First Time

Get all 359 exam questions with verified answers and 90-day free updates.

Buy Now & Pass
  • PDF + Practice Test Bundle
  • 90-Day Free Updates
  • 100% Money-Back Guarantee
  • Instant Download
  • 24/7 Customer Support
99% Pass Rate Trusted by 50,000+ IT professionals