Sample Questions - Terraform Infrastructure Engineer Professional
Terraform Infrastructure Engineer Professional certification exams include multiple-choice and multiple-answer questions. Below are some example questions to introduce you to the question format you will encounter on the exam.
The exam questions are not intended to trick you. The exam tests your knowledge of Terraform, not how well you spell or how good you are at identifying obscure details.
Visit the HashiCorp Cloud Engineer Certification page for more information and to sign up for the exam.
Multiple-choice questions
Multiple-choice questions ask you to select one correct answer from a list.
Question 1
Which action ensures that an AI coding assistant has access to the most current Terraform provider documentation when generating Terraform configurations?
⬜ Set a >= version constraint in required_providers so the coding agent uses the newest provider.
⬜ Provide the MCP server with a link to the change log for the currently installed Terraform version.
⬜ Deploy the Terraform MCP server with the default configurations and connect it to the coding assistant.
⬜ Run terraform init -upgrade to install the newest provider version so it can be used by the coding agent.
❌ Incorrect: Set a >= version constraint in required_providers so the coding agent uses the newest provider.
❌ Incorrect: Provide the MCP server with a link to the change log for the currently installed Terraform version.
✅ Correct: Deploy the Terraform MCP server with the default configurations and connect it to the coding assistant.
❌ Incorrect: Run terraform init -upgrade to install the newest provider version so it can be used by the coding agent.
Question 2
Consider the following backend configuration:
terraform {
required_version = ">= 1.10.0"
backend "s3" {
bucket = "my-company-terraform-state"
key = "environments/production/terraform.tfstate"
region = "us-east-1"
use_lockfile = true
encrypt = true
}
}
Two engineers run terraform apply against this backend configuration above at nearly the same time. What is the result of these actions?
⬜ Terraform will try to achieve the desired state in parallel.
⬜ The second terraform apply will wait for the first terraform apply to finish.
⬜ The second terraform apply will error with Error: Error acquiring the state lock.
⬜ The first terraform apply will be canceled once the second terraform apply begins.
❌ Incorrect: Terraform will try to achieve the desired state in parallel.
❌ Incorrect: The second terraform apply will wait for the first terraform apply to finish.
✅ Correct: The second terraform apply will error with Error: Error acquiring the state lock.
❌ Incorrect: The first terraform apply will be canceled once the second terraform apply begins.
Question 3
Consider the following configuration:
module "networking" {
source = "app.terraform.io/ACME/networking/aws"
}
variable "tags" {
type = map(string)
default = {
Department = "Platform"
Environment = "Development"
}
}
locals {
all_tags = # Answer goes here
}
The networking module returns an output named tags that is a map of strings with the tags added to each resource. An organization wants to deploy additional infrastructure that combines these tags as well as their own custom tags. Which option combines the two sets of tags into a single map?
⬜ module.networking.tags + var.tags
⬜ {module.networking.tags, var.tags}
⬜ join(module.networking.tags, var.tags)
⬜ merge(module.networking.tags, var.tags)
❌ Incorrect: module.networking.tags + var.tags
❌ Incorrect: {module.networking.tags, var.tags}
❌ Incorrect: join(module.networking.tags, var.tags)
✅ Correct: merge(module.networking.tags, var.tags)
Question 4
An organization needs to move to a newer Terraform version, but they are using a registry module pinned to version = "1.4.0", which does not support it. However, the latest release of the module does support it. How does the engineer upgrade the module?
⬜ Update the version argument in the module block, then run terraform init -upgrade.
⬜ Run terraform init -upgrade so Terraform selects the latest release automatically.
⬜ Delete the .terraform.lock.hcl file, then re-run terraform init to refresh versions.
⬜ Update the required_version in the terraform block to match the new Terraform release.
✅ Correct: Update the version argument in the module block, then run terraform init -upgrade.
❌ Incorrect: Run terraform init -upgrade so Terraform selects the latest release automatically.
❌ Incorrect: Delete the .terraform.lock.hcl file, then re-run terraform init to refresh versions.
❌ Incorrect: Update the required_version in the terraform block to match the new Terraform release.
Multiple-answer questions
Multiple-answer questions ask you to select multiple correct answers from a list. The question indicates how many answers you must choose.
Question 5
A sandbox instance will no longer be managed by Terraform but must remain deployed in the cloud. After removing the resource block from the Terraform configuration, which two actions would prevent Terraform from destroying the instance in the next run?
⬜ Create an import block
⬜ Create a moved block
⬜ Create a removed block
⬜ Run terraform state rm "aws_instance.sandbox"
⬜ Run terraform destroy -target aws_instance.sandbox
❌ Incorrect: Create an import block
❌ Incorrect: Create a moved block
✅ Correct: Create a removed block
✅ Correct: Run terraform state rm "aws_instance.sandbox"
❌ Incorrect: Run terraform destroy -target aws_instance.sandbox
Continue studying
For documentation and tutorials mapped to each exam objective, review the Terraform Infrastructure Engineer Professional content list. Use the learning path for a curated set of resources.