
HashiCorp Certified:Terraform Associate
Domain 5Objective 2
5b Describe Variable Scope Within Modules TERRAFORM-ASSOCIATE-004 Practice Questions (Page 2)
Part of the Terraform modules domain, which makes up ~8% of our current practice bank. HashiCorp does not publish an official question count, but from its 60-minute exam (~25–40 total, ~2–3 in this domain), expect 1–1 from this objective — we provide 26 practice questions to prepare you well beyond it. (estimate)
26questions here
6free pages
5concepts
Questions 6–10
- 6
A module defines a variable named `instance_count`. How can the root module reference this variable?
Select an answer first - 7
A root configuration defines a variable named `environment` with value `prod`. It calls a module that also declares an input variable named `environment` with a default of `dev`. The module block does not pass `environment`. What value does the module see for `environment`?
Select an answer first - 8
A root configuration has a variable `region = "us-east-1"`. It calls a module that declares `variable "region" { default = "eu-west-1" }`. The module block does not pass `region`. What value does the module use?
Select an answer first - 9
A root configuration defines `variable "cidr" { default = "10.0.0.0/16" }`. It calls a module that declares `variable "cidr" { default = "192.168.0.0/16" }`. The module block passes `cidr = "172.16.0.0/16"`. Inside the module, a resource uses `var.cidr`. What value does the resource get?
Select an answer first - 10
A root configuration defines `locals { vpc_id = "vpc-123" }` and calls a module that declares `variable "vpc_id" { type = string }`. The module block passes `vpc_id = local.vpc_id`. Inside the module, a local `subnet_cidr = "10.0.1.0/24"` is used. The root configuration also needs `subnet_cidr`. What is the correct way to obtain it?
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.