ExamDumpster

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 financial services company is using Terraform to manage a multi-tenant environment where each tenant's infrastructure is defined in a separate module. To ensure strict isolation and prevent accidental cross-tenant modifications, the lead architect has mandated that each module invocation must use a unique provider configuration with tenant-specific credentials. How can this be achieved within the root module?

Question 2Choose one

A DevOps team is managing a large-scale application on AWS using Terraform. They have a module that creates an S3 bucket with logging enabled. The logging bucket must be created in a separate security account. The team has configured two AWS provider instances in their root module: one default and one with an alias `security`. How must they configure the S3 bucket module to ensure the main bucket uses the default provider and the logging bucket uses the `security` provider?

Question 3Choose 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 4Choose 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 5Choose 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 6Choose 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 7Choose 2

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

Question 8Choose 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 9Choose 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 10Choose one

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

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