
HashiCorp Certified:Terraform Associate
Domain 5Objective 2
5b Describe Variable Scope Within Modules TERRAFORM-ASSOCIATE-004 Practice Questions (Page 5)
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 21–25
- 21
A module creates a VPC and defines `output "vpc_id" { value = aws_vpc.this.id }`. The root configuration references `module.vpc.vpc_id` in a resource. The module is later refactored to use a local value `vpc_id` instead of the resource attribute directly in the output. What must be done to keep the root configuration working?
Select an answer first - 22
A team maintains a module that provisions a load balancer. The module declares `variable "listener_port" { type = number }` and `output "listener_arn" { value = aws_lb_listener.this.arn }`. The root configuration passes `listener_port = 443`. Later, the team wants the root configuration to also know the listener's protocol, which is hardcoded as `HTTPS` inside the module. What is the minimal change to expose the protocol to the root configuration?
Select an answer first - 23
A module declares `variable "instance_type" { type = string }` with no default. The root configuration calls the module and passes `instance_type = "t3.micro"`. Later, the root configuration is modified to remove that argument from the module block. What happens on the next plan?
Select an answer first - 24
Which block is used to pass values from the parent configuration into a module's input variables?
Select an answer first - 25
A root configuration has `variable "tags" { default = { Env = "dev" } }`. It calls a module that declares `variable "tags" { type = map(string) }` with no default. The module block passes `tags = { Env = "prod" }`. Inside the module, a resource uses `var.tags`. What value does the resource see?
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.