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.
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?
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?
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.
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?
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?
Which of the following are valid sources for a Terraform module in a `module` block? (Select TWO)
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?
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?
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.