Back to HashiCorp Terraform Associate TF-003 questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise HashiCorp Terraform Associate TF-003 practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
TF-003
exam code
HashiCorp
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related TF-003 topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1easymultiple choice
Read the full NAT/PAT explanation →

Refer to the exhibit. A developer runs `terraform apply` and the operation succeeds. Later, they manually terminate the EC2 instance through the AWS console. What will happen when the developer runs `terraform apply` again?

Exhibit

Refer to the exhibit.
```hcl
resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"

  tags = {
    Name = "WebServer"
  }
}

resource "aws_eip" "ip" {
  instance = aws_instance.web.id
}
```
Question 2hardmultiple choice
Full question →

Refer to the exhibit. After applying this configuration, a team member manually changes the instance type to 't2.small' via the AWS console. The next `terraform plan` shows a change to revert to 't2.micro'. What does this demonstrate?

Exhibit

resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
  tags = {
    Name = "WebServer"
  }
}
Question 3hardmultiple choice
Full question →

Refer to the exhibit. An engineer runs 'terraform plan' and receives an error: 'Error refreshing state: state data in S3 does not have the expected content.' The state file exists and is not corrupted. What is the most likely cause?

Exhibit

terraform {
  backend "s3" {
    bucket         = "my-terraform-state"
    key            = "prod/terraform.tfstate"
    region         = "us-east-1"
    dynamodb_table = "terraform-locks"
    encrypt        = true
  }
}

resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
}
Question 4hardmultiple choice
Full question →

Refer to the exhibit. A developer runs terraform plan and receives this error. What should the developer do to resolve the error?

Exhibit

Error: Backend initialization required: please run "terraform init"

Reason: Backend configuration has changed.

The configured backend "s3" has changed since the last "terraform init".
Previous configuration:
  bucket = "prod-terraform-state"
  key    = "network/terraform.tfstate"
  region = "us-east-1"

New configuration:
  bucket = "prod-terraform-state"
  key    = "network/terraform.tfstate"
  region = "us-west-2"
Question 5hardmultiple choice
Full question →

A user receives the error shown in the exhibit when running `terraform init`. The user is behind a corporate proxy. Which environment variable should be set to resolve this issue?

Exhibit

Refer to the exhibit.

```
Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider hashicorp/aws:
  could not connect to the registry: the request failed after 2 attempts, please check your internet connection
```
Question 6hardmultiple choice
Full question →

Refer to the exhibit. A developer runs terraform plan and sees "No changes". However, the developer knows that manual changes were made to the infrastructure outside Terraform. What is the most likely reason terraform plan does not detect the drift?

Exhibit

$ terraform init
Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend for state storage.

Initializing provider plugins...
- Finding latest version of hashicorp/aws...
- Installing hashicorp/aws v4.0.0...
- Installed hashicorp/aws v4.0.0 (signed by HashiCorp)

Terraform has been successfully initialized!

$ terraform plan

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
Question 7mediummultiple choice
Full question →

Refer to the exhibit. The user runs 'terraform plan' and sees that Terraform wants to create the instance. However, the instance already exists in the AWS account with the same configuration. What is the most likely reason?

Exhibit

resource "aws_instance" "example" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
}
Question 8easymultiple choice
Full question →

Refer to the exhibit. A Terraform plan fails with the error shown. What is the most likely cause?

Exhibit

Error: Error acquiring the state lock

  on <empty> line 0:
  (source code not available)

ConditionalCheckFailedException: The conditional request failed
Question 9mediummultiple choice
Full question →

Refer to the exhibit. A Terraform Cloud plan includes an EC2 instance of type 't2.medium'. The team uses Sentinel policies. Which action should they take to proceed?

Exhibit

Sentinel policy "restrict-instance-types" evaluation resulted in "failure".
Description: Instance types must be t2.micro or t2.small.
Question 10easymultiple choice
Full question →

Refer to the exhibit. A team deploys this configuration. They run 'terraform apply' once and the instance is created. Later, they modify the instance type and run 'terraform apply' again. They notice the provisioner does not run on the second apply. Why?

Exhibit

resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
  provisioner "local-exec" {
    command = "echo ${aws_instance.web.private_ip} > /tmp/ip.txt"
  }
}
Question 11hardmultiple choice
Full question →

Refer to the exhibit. A user encounters this error while running 'terraform plan'. What is the best course of action?

Exhibit

Error: Error acquiring the state lock
...
Lock Info:
  ID:        abc123
  Path:      terraform.tfstate
  Operation: OperationTypeInvalid
  Who:       user@host
  Version:   0.12.0
  Created:   2019-10-17 12:00:00
  Info:
Question 12easymultiple choice
Full question →

Refer to the exhibit. Which command was most likely executed?

Exhibit

Initializing modules...
Downloading registry.terraform.io/hashicorp/consul/aws 0.1.0...
- consul in modules/consul
Question 13easymultiple choice
Full question →

Refer to the exhibit. What will happen when terraform plan is run?

Exhibit

resource "aws_s3_bucket" "example" {}
Question 14hardmultiple choice
Full question →

Refer to the exhibit. What is the most likely cause of this error?

Exhibit

Error: Could not satisfy version constraint for provider hashicorp/aws: required version >= 3.0, installed version 2.70
Question 15mediummultiple choice
Full question →

Refer to the exhibit. What does this output indicate?

Exhibit

Output of `terraform state list`:
aws_instance.web

These TF-003 practice questions are part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style TF-003 questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.