HashiCorp Certified: Terraform Associate (004) Free Sample Questions

Description

Covers infrastructure as code concepts, Terraform providers and configuration, the core write-plan-apply workflow, resources, variables, and modules, and state management and HCP Terraform.

12 free sample questions132 in the full practice test

Try simulator

TA-004 Sample Questions

  1. Question 1

    Beginner

    Infrastructure as Code (IaC) with Terraform · Describe the advantages of IaC patterns

    A DevOps engineer at TechCorp is designing a disaster recovery strategy for their multi-cloud infrastructure. The infrastructure is defined using Terraform to ensure consistency across AWS and Azure environments. Which core Infrastructure as Code (IaC) benefit is primarily being leveraged when the engineer uses the same configuration files to rapidly redeploy the entire stack in a secondary region during an outage?

    Answer and explanation

    Correct answer: A

    Repeatability is the specific IaC benefit that allows the exact same infrastructure to be provisioned multiple times in different environments or regions based on the same code definition. While idempotency ensures a single apply doesn't break things, repeatability is the strategic benefit for DR.

  2. Question 2

    Intermediate

    Infrastructure as Code (IaC) with Terraform · Explain how Terraform manages multi-cloud, hybrid cloud, and service-agnostic workflows

    An organization is migrating a legacy manual provisioning process to Terraform. The Chief Architect asks you to explain how Terraform handles the underlying API differences between cloud providers like AWS and Google Cloud Platform (GCP) while maintaining a consistent workflow for developers. Which concept best describes this capability?

    Answer and explanation

    Correct answer: A

    Terraform Core is cloud-agnostic and handles the workflow (Plan, Apply, State). It relies on specific Providers (plugins) to translate these lifecycle events into the specific API calls required by the target platform (AWS, Azure, etc.).

  3. Question 3

    Beginner

    Infrastructure as Code (IaC) with Terraform · Explain what IaC is

    True or False: Terraform's declarative nature means that the order in which resources are defined in the configuration file dictates the order in which they are provisioned during the apply phase.

    Answer and explanation

    Correct answer: B

    False. Terraform is declarative. The order of provisioning is determined by the dependency graph derived from implicit and explicit dependencies, not the order of the text blocks in the file.

  4. Question 4

    Intermediate

    Infrastructure as Code (IaC) with Terraform · Explain how Terraform manages multi-cloud, hybrid cloud, and service-agnostic workflows

    A platform team manages a complex application stack using IaC. To ensure high availability, they want to deploy the application across multiple distinct cloud providers (e.g., AWS and Azure) using a single Terraform configuration. Which statement accurately describes the feasibility and approach for this requirement?

    Answer and explanation

    Correct answer: C

    Terraform supports multi-cloud orchestration within a single configuration by simply defining multiple provider blocks (e.g., one for aws and one for azurerm). Resources are then associated with the respective providers.

  5. Question 5

    Beginner

    Terraform Fundamentals · Install and version Terraform providers

    You have added a new provider to your existing versions.tf file. When you attempt to run terraform plan, you receive an error stating the provider is missing. What is the immediate next step you must take to resolve this?

    Answer and explanation

    Correct answer: A

    Whenever a new provider is added or a version constraint is changed, terraform init must be run to download the plugin binary to the .terraform directory and update the .terraform.lock.hcl file.

  6. Question 6

    Intermediate

    Terraform Fundamentals · Install and version Terraform providers

    A team needs to ensure that the exact same version of a Terraform provider is used by every developer and the CI/CD pipeline to prevent "works on my machine" issues. Which file is primarily responsible for enforcing these specific checksum-verified versions?

    Answer and explanation

    Correct answer: B

    The dependency lock file (.terraform.lock.hcl) records the exact versions and checksums of all providers used. Committing this file ensures that terraform init installs the exact same versions across all environments.

Register free for 6 more questions

Or unlock all 132 TA-004 questions with explanations, timed mode and flashcards.