Back to HashiCorp Terraform Associate TF-003 questions

Scenario-based practice

Hard Difficulty 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.

20
scenario questions
TF-003
exam code
HashiCorp
vendor

Scenario guide

How to approach hard difficulty questions

These are the questions most candidates get wrong. They require connecting multiple concepts, reading tricky output, or knowing edge-case behaviour that isn't on most study cards. Practising them trains you to operate under uncertainty — a necessary skill on the real exam.

Quick answer

Hard Difficulty Questions questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider 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 1hardmulti select
Full question →

Which THREE of the following are benefits of using Infrastructure as Code (IaC) compared to manual infrastructure management?

Question 2hardmultiple choice
Full question →

During a `terraform apply`, the operation fails mid-way due to a network outage, leaving some resources created. The operator wants to resume applying from where it left off without destroying the already-created resources. What should they do?

Question 3hardmulti select
Full question →

Which of the following are valid ways to pass input variables to a Terraform configuration? (Select all that apply.)

Question 4hardmultiple choice
Full question →

A DevOps engineer is troubleshooting a failed 'terraform plan' command. The error message is: 'Error: Error acquiring the state lock' followed by a message that the lock is held by another process. The team uses Terraform Cloud with remote state. Which of the following is the most likely cause and correct resolution?

Question 5hardmulti select
Full question →

Which THREE practices are recommended when using Terraform modules? (Select THREE.)

Question 6hardmultiple choice
Full question →

A company uses Terraform Cloud and wants to enforce policies that prevent creating resources with public IP addresses unless explicitly approved. What Terraform Cloud feature should they use?

Question 7hardmultiple choice
Full question →

An organization uses Terraform workspaces to manage multiple environments (dev, staging, prod). They notice that terraform plan in the prod workspace unexpectedly shows changes to a resource that should be identical across workspaces. The resource uses a backend that stores state in an S3 bucket. What is the most likely cause?

Question 8hardmultiple choice
Full question →

A user runs 'terraform plan' and gets an error: 'No state file was found!'. Which is the most likely cause?

Question 9hardmultiple choice
Full question →

A Terraform configuration includes a variable for a database password marked as sensitive. When a user runs 'terraform apply', the password appears as (sensitive) in the plan output. However, they want to pass this password to a provisioner as an environment variable. What should they do?

Question 10hardmultiple 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 11hardmultiple 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 12hardmultiple 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 13hardmultiple choice
Full question →

A company uses Terraform with multiple cloud providers and wants to integrate with their existing CI/CD pipeline. They need to enforce that all infrastructure changes go through code review and automated testing before being applied to production. Which approach best meets these requirements?

Question 14hardmultiple choice
Full question →

A team is using Terraform to manage multiple environments (dev, staging, prod) with the same configuration but different variable values. They want to avoid duplicating configuration files. Which Terraform feature is best suited for this?

Question 15hardmultiple 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 16hardmultiple choice
Full question →

After running 'terraform apply', the user sees that the 'aws_s3_bucket_object' is created successfully, but the bucket name is not as expected. What is the most likely reason?

Exhibit

Refer to the exhibit.

```hcl
module "bucket" {
  source = "./modules/s3-bucket"
  bucket_name = "my-app-data"
}

resource "aws_s3_bucket_object" "config" {
  bucket = module.bucket.bucket_name
  key    = "config.json"
  source = "config.json"
}
```

The module at './modules/s3-bucket' contains:

```hcl
variable "bucket_name" {}
resource "aws_s3_bucket" "this" {
  bucket = var.bucket_name
}
output "bucket_name" {
  value = aws_s3_bucket.this.id
}
```
Question 17hardmultiple 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 18hardmultiple choice
Full question →

A developer creates a module that provisions an AWS EC2 instance and an S3 bucket. The module outputs the instance ID and bucket ARN. When using this module, the root configuration references module.my_module.instance_id and module.my_module.bucket_arn. After running terraform apply, they notice that the bucket ARN is empty. What is the most likely cause?

Question 19hardmultiple choice
Full question →

A Terraform configuration uses a module from the Terraform Registry. After updating the module version in the configuration, the operator runs 'terraform plan' but does not see the changes expected from the new version. What is the most likely cause?

Question 20hardmultiple choice
Full question →

An organization uses Terraform with remote state stored in S3 and DynamoDB for state locking. During a plan, they receive the error: 'Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed'. What is the most likely cause?

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.