
HashiCorp Certified:Terraform Associate
Domain 4Objective 6
4f Define Resource Dependencies in Configuration TERRAFORM-ASSOCIATE-004 Practice Questions (Page 2)
Part of the Terraform configuration domain, which makes up ~22% of our current practice bank. HashiCorp does not publish an official question count, but from its 60-minute exam (~25–40 total, ~6–9 in this domain), expect 1–1 from this objective — we provide 15 practice questions to prepare you well beyond it. (estimate)
15questions here
3free pages
5concepts
Questions 6–10
- 6
A team is using Terraform to provision a database and an application. The application's configuration file (created by a local_file resource) contains the database's connection string. The connection string is built using a template that references the database resource. The team notices that the local_file is sometimes created before the database. What is the most likely cause?
Select an answer first - 7
A Terraform configuration creates an AWS IAM role and an IAM policy. The policy must be attached to the role, but the attachment resource does not reference any attribute of the role or policy. What should be added to the attachment resource to ensure the role and policy are created first?
Select an answer first - 8
A developer writes Terraform configuration for a VPC and a subnet. The subnet block uses the VPC's ID: subnet_id = aws_vpc.main.id. The developer is surprised that the subnet is created after the VPC even though no depends_on is present. Why does Terraform know to create the subnet after the VPC?
Select an answer first - 9
A team is provisioning a web server and a database. The web server's user data script needs the database's endpoint, but the endpoint is only known after the database is created. The team writes the configuration so the web server references the database's endpoint attribute directly. What is the result?
Select an answer first - 10
A Terraform configuration creates an Azure resource group and a storage account. The storage account must be created after the resource group, but the configuration does not reference any attribute of the resource group. What should be added to the storage account resource block to enforce this ordering?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by HashiCorp. “TERRAFORM-ASSOCIATE-004” is a trademark of its owner, used for identification only.