Question 1
In a Terraform configuration, what determines the order in which Terraform creates resources?
Show answer & explanation
Correct answer: A - A dependency graph Terraform builds from references between resources
10 free, exam-style HCTA (HCTA) practice questions with answers and explanations. No signup required. Work through them below, then take the full free HCTA practice test to study every exam domain.
In a Terraform configuration, what determines the order in which Terraform creates resources?
Correct answer: A - A dependency graph Terraform builds from references between resources
A provider is constrained with ~> 1.2.0. Which provider versions is Terraform allowed to select?
Correct answer: C - Any release from 1.2.0 up to but not including 1.3.0
An engineer runs terraform plan -out=tfplan, then later runs terraform apply tfplan. Assuming the state has not changed in between, what does Terraform do with the saved plan?
Correct answer: D - It applies exactly the saved plan, without prompting for approval
While reviewing the output of terraform plan, an engineer sees -/+ next to a resource. What will Terraform do to that resource?
Correct answer: B - Destroy the existing resource and then create a new one
The variable region is set to us-east-1 in terraform.tfvars and is also passed on the command line as -var="region=us-west-2". Which value does Terraform use?
Correct answer: A - us-west-2, because a command-line -var flag has the highest precedence
An engineer must manage several S3 buckets that are not interchangeable, so that removing one from the middle does not change the identity of the others. Which approach is recommended?
Correct answer: C - Use for_each with a map or set, so each bucket has a stable key
A team wants to pin a module to a specific release using the version argument. For which module source does the version argument actually take effect?
Correct answer: D - A module sourced from the Terraform Registry
A database password is passed into a resource using an input variable marked sensitive = true. How is that password stored in the Terraform state file?
Correct answer: B - In plain text
An administrator created an S3 bucket manually in the cloud console, then runs terraform import aws_s3_bucket.data my-existing-bucket. What does this command do?
Correct answer: A - Records the existing bucket in state, but does not write its configuration
In HCP Terraform, a Sentinel policy is configured with the soft-mandatory enforcement level. What happens when a run violates that policy?
Correct answer: C - The run is blocked, but an authorized user can override it and continue
Practice hundreds more HCTA questions with instant scoring, weak-area drills, and full exam simulations.