CertificationTestPrep Free diagnostic

HashiCorp · Associate

Free HashiCorp Terraform Associate practice questions

This page has 10 free practice questions: no account needed, and every option explains why it’s right or wrong. They come from the HashiCorp Terraform Associate bank of 1297, spread across all eight domains, weighted by each domain’s share of the sub-objectives. The free diagnostic asks 20 more, also with no account needed and every answer explained.

Question 1 of 10 · Multiple choice · Domain 1 · Infrastructure as Code (IaC) with Terraform (8%)

A team keeps its DNS entries with a third-party DNS vendor and wants them defined next to its servers. Can Terraform manage components like that?

Question 2 of 10 · Multiple choice · Domain 2 · Terraform fundamentals (11%)

A configuration has a default AWS configuration and an aliased one, and a data source that sets no provider argument.

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

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

data "aws_ami" "base" {
  most_recent = true
  owners      = ["self"]
}

Which configuration does the data source use?

Question 3 of 10 · Multiple choice · Domain 3 · Core Terraform workflow (19%)

After terraform destroy finishes, a developer runs two commands:

$ terraform state list
$ terraform show
The state file is empty. No resources are represented.

What does this show?

Question 4 of 10 · Multiple choice · Domain 3 · Core Terraform workflow (19%)

A repository holds these files:

main.tf
modules/network/main.tf
modules/storage/main.tf

A developer runs terraform fmt with no options in the repository root. Which files does it process?

Question 5 of 10 · Multiple choice · Domain 4 · Terraform configuration (21%)

A resource sets its input from an indented heredoc.

resource "terraform_data" "script" {
  input = <<-EOT
    echo one
      echo two
    EOT
}

What is the value of input?

Question 6 of 10 · Multiple choice · Domain 4 · Terraform configuration (21%)

A policy resource has an update pending in this plan, and a data block lists it in depends_on:

resource "aws_iam_role_policy" "logs" {
  name   = "logs-access"
  role   = "app-role"
  policy = file("${path.module}/logs-policy.json")
}

data "aws_iam_role" "app" {
  name       = "app-role"
  depends_on = [aws_iam_role_policy.logs]
}

The policy file changed, so the policy will be updated. When does Terraform read data.aws_iam_role.app?

Question 7 of 10 · Multiple choice · Domain 5 · Terraform modules (11%)

Terraform runs in envs/prod, and the shared database module sits in modules/db at the top of the repository.

repo/
├── envs/
│   └── prod/
│       └── main.tf
└── modules/
    └── db/
        └── main.tf

Which source in envs/prod/main.tf reaches that module?

Question 8 of 10 · Multiple choice · Domain 6 · Terraform state management (11%)

The network configuration manages aws_subnet.private and declares only output “vpc_id”. The application configuration reads:

subnet_id = data.terraform_remote_state.net.outputs.private_subnet_id

Planning fails with: This object does not have an attribute named “private_subnet_id”. Why?

Question 9 of 10 · Multiple choice · Domain 7 · Maintain infrastructure with Terraform (8%)

A configuration declares output “connection_string”, built from a database’s hostname and port with format. An engineer wants that exact string. Which command prints it?

Question 10 of 10 · Multiple choice · Domain 8 · HCP Terraform (11%)

A team is converting this block to a cloud block with the same organization, so that it reaches the same workspaces:

terraform {
  backend "remote" {
    organization = "acme"

    workspaces {
      prefix = "web-"
    }
  }
}

What replaces prefix inside workspaces?

Where do you stand?

20 more free questions, and a map of every skill.

The free diagnostic asks 20 questions weighted by each domain’s share of the sub-objectives and shows which skills on the HashiCorp Terraform Associate exam you know and which you don’t. Full access is $19 for all 1297 questions, with practice that follows what you miss.