Free terraform-associate-003 sample questions

Real questions from the HashiCorp Certified: Terraform Associate (003) practice bank, with the correct answer and an explanation for each one. No junk, no filler.

Try them in the simulator Same questions, with study, timed and flashcard modes.

Showing 10 of 20 free sample questions.

Question 1Choose one

A Terraform configuration contains the following code: ```hcl locals { instances = { "web-1" = { type = "t3.medium", zone = "us-east-1a" } "app-1" = { type = "m5.large", zone = "us-east-1b" } } } resource "aws_instance" "server" { for_each = local.instances ami = "ami-0c55b159cbfafe1f0" instance_type = each.value.type availability_zone = each.value.zone } ``` How would you reference the availability zone of the `app-1` instance in an output value?

Question 2Choose one

True or False: Using the `terraform state replace-provider` command is the recommended method for upgrading a provider to a new major version within your configuration.

Question 3Choose one

A team is building a reusable Terraform module to create a web application stack. They want to allow consumers of the module to optionally define a set of firewall rules. Each rule is an object with `protocol`, `from_port`, `to_port`, and `cidr_blocks`. Which Terraform language feature should be used to dynamically generate the `ingress` blocks for the security group resource based on a variable list of rule objects?

Question 4Choose one

A developer is writing a Terraform configuration and needs to ensure that a variable `instance_count` is always a positive integer greater than zero. Which of the following code blocks correctly implements this validation?

Question 5Choose 2

Which of the following are valid sources for a Terraform module in a `module` block? (Select TWO)

Question 6Choose one

A CI/CD pipeline running on a Linux agent executes `terraform plan`. The same configuration, when planned on a developer's macOS laptop, shows no changes. However, the pipeline's plan shows a provider version change and wants to update the lock file. What is the most likely cause of this discrepancy?

Question 7Choose one

A new team member runs `terraform plan` and receives an error message: `Error: Missing required argument`. The missing argument is for a resource that is created by a colleague's configuration in a separate directory. The team is using a shared remote state backend. What is the most effective way to resolve this error?

Question 8Choose one

When working with HCP Terraform, what is the primary purpose of a workspace?

Question 9Choose 3

What are the key benefits of using a remote backend such as Amazon S3 with DynamoDB instead of the default local backend? (Select THREE)

Question 10Choose one

During a `terraform apply`, an engineer accidentally closes their terminal. Upon re-running `terraform apply`, they receive an error indicating the state is locked. The lock ID belongs to the original, terminated process. What is the safest command to resolve this situation?

10 more free samples are waiting

Create a free account to unlock the whole terraform-associate-003 sample bank, or get full access to all 207 practice questions in the simulator.

Create account