HashiCorp Terraform Associate Practice Test 39
Question 380
A service module must create a new virtual network, but its author uses a Terraform data block pointing to a network that does not exist. The team has implemented an approved Terraform change. Which observed result most directly confirms that the original requirement is now met, beyond a successful command exit code?
- The child receives the intended environment value independent of naming coincidence.
- Either branch produces a consistent list suitable for downstream resources.
- Every approved rule is represented without hand-copied configuration drift.
- Terraform plans creation of the intended network rather than failing a lookup.
Explanation
Correct Answer
D:This is the appropriate measurable post-change acceptance criterion: Terraform plans creation of the intended network rather than failing a lookup. A successful Terraform command or a completed change request alone would not demonstrate that outcome. Preserve this control during validation: Validate provider resource requirements and review the plan.
Incorrect Answers
A:“The child receives the intended environment value independent of naming coincidence” would address a different Terraform configuration concern; the source instead describes A service module must create a new virtual network, but its author uses a Terraform data block pointing to a network that does not exist. The appropriate design is to use a managed resource block to declare the new network and reserve data blocks for reading existing objects. Confirm whether terraform plans creation of the intended network rather than failing a lookup.
B:“Either branch produces a consistent list suitable for downstream resources” would address a different Terraform configuration concern; the source instead describes A service module must create a new virtual network, but its author uses a Terraform data block pointing to a network that does not exist. The appropriate design is to use a managed resource block to declare the new network and reserve data blocks for reading existing objects. Confirm whether terraform plans creation of the intended network rather than failing a lookup.
C:“Every approved rule is represented without hand-copied configuration drift” would address a different Terraform configuration concern; the source instead describes A service module must create a new virtual network, but its author uses a Terraform data block pointing to a network that does not exist. The appropriate design is to use a managed resource block to declare the new network and reserve data blocks for reading existing objects. Confirm whether terraform plans creation of the intended network rather than failing a lookup.
Question 381
A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The infrastructure review requires a supported, least-disruptive Terraform solution. Which proposed change most directly addresses this specific situation?
- Reference the managed load balancer attribute from the firewall rule to express the correct dependency.
- Use a resource or data-source precondition where appropriate to enforce the required operational invariant.
- Use a suitable postcondition on the relevant managed value to verify the resulting attribute.
- Use for_each keyed by stable subnet identifiers rather than a shifting positional list for independently named objects.
Explanation
Correct Answer
A:The proposed intervention addresses the reported Terraform engineering failure: A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. It applies the design choice Reference the managed load balancer attribute from the firewall rule to express the correct dependency. Review the primary diagnostic: Inspect the load balancer resource's exported address attribute. The expected outcome is: The firewall rule follows the allocated address without hardcoded temporary values. The rollout safeguard is: Check planned dependencies and verify ingress connectivity after apply.
Incorrect Answers
B:“Use a resource or data-source precondition where appropriate to enforce the required operational invariant” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
C:“Use a suitable postcondition on the relevant managed value to verify the resulting attribute” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
D:“Use for_each keyed by stable subnet identifiers rather than a shifting positional list for independently named objects” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
Question 382
A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. Before choosing a remedy, the team needs independent evidence of the actual root cause. Which TWO checks most directly test this case? (Select TWO.)
- Inspect which map keys are required versus optional.
- Inspect actual state content and variable consumer contexts.
- Review the resulting dependency graph and calculated firewall rule input.
- Inspect the load balancer resource's exported address attribute.
- Inspect the root module call's argument map.
Explanation
Correct Answers
C:This is directly relevant evidence for the reported behavior: Review the resulting dependency graph and calculated firewall rule input. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Reference the managed load balancer attribute from the firewall rule to express the correct dependency. The expected confirmation is The firewall rule follows the allocated address without hardcoded temporary values.
D:This is directly relevant evidence for the reported behavior: Inspect the load balancer resource's exported address attribute. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Reference the managed load balancer attribute from the firewall rule to express the correct dependency. The expected confirmation is The firewall rule follows the allocated address without hardcoded temporary values.
Incorrect Answers
A:“Inspect which map keys are required versus optional” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
B:“Inspect actual state content and variable consumer contexts” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
E:“Inspect the root module call's argument map” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
Question 383
A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. If this behavior continues without correction, which specific risk is most closely supported by the facts, without assuming harm has already occurred?
- A secret assumed ephemeral may still be exposed if copied to persistent attributes.
- Manual address copying can create stale rules after replacement.
- Loose or wrong type assumptions can create invalid network rules.
- Index churn may cause unnecessary destructive replacements.
Explanation
Correct Answer
B:The reported condition creates the specific potential exposure: Manual address copying can create stale rules after replacement. A risk is not evidence that every adverse outcome already occurred. Two independent checks can corroborate the assessment. First diagnostic: Inspect the load balancer resource's exported address attribute. Second diagnostic: Review the resulting dependency graph and calculated firewall rule input.
Incorrect Answers
A:“A secret assumed ephemeral may still be exposed if copied to persistent attributes” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
C:“Loose or wrong type assumptions can create invalid network rules” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
D:“Index churn may cause unnecessary destructive replacements” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
Question 384
A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. A reviewer asks for BOTH a targeted technical response and a corresponding change-control safeguard. Which TWO actions together meet that requirement? (Select TWO.)
- Declare an explicit root output for the required subnet ID and consume that supported interface.
- Reference the managed load balancer attribute from the firewall rule to express the correct dependency.
- Validate both branches and confirm defaults.
- Document defaults and validate supported timeout ranges.
- Check planned dependencies and verify ingress connectivity after apply.
Explanation
Correct Answers
B:This is one of the two necessary decisions for a safe design: Reference the managed load balancer attribute from the firewall rule to express the correct dependency. Together the corrective action and its implementation safeguard need to address the recorded condition: A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. Acceptance requires The firewall rule follows the allocated address without hardcoded temporary values.
E:This is one of the two necessary decisions for a safe design: Check planned dependencies and verify ingress connectivity after apply. Together the corrective action and its implementation safeguard need to address the recorded condition: A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. Acceptance requires The firewall rule follows the allocated address without hardcoded temporary values.
Incorrect Answers
A:“Declare an explicit root output for the required subnet ID and consume that supported interface” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
C:“Validate both branches and confirm defaults” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
D:“Document defaults and validate supported timeout ranges” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
Question 385
A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The team has implemented an approved Terraform change. Which observed result most directly confirms that the original requirement is now met, beyond a successful command exit code?
- Resources share the same approved naming pattern.
- The resource exists once with the correct optional logging configuration.
- The migration preserves availability without impossible duplicate naming.
- The firewall rule follows the allocated address without hardcoded temporary values.
Explanation
Correct Answer
D:This is the appropriate measurable post-change acceptance criterion: The firewall rule follows the allocated address without hardcoded temporary values. A successful Terraform command or a completed change request alone would not demonstrate that outcome. Preserve this control during validation: Check planned dependencies and verify ingress connectivity after apply.
Incorrect Answers
A:“Resources share the same approved naming pattern” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
B:“The resource exists once with the correct optional logging configuration” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
C:“The migration preserves availability without impossible duplicate naming” would address a different Terraform configuration concern; the source instead describes A company requires a web server's firewall rule to use the address allocated by a Terraform-managed load balancer, but the engineer copies the temporary address manually. The appropriate design is to reference the managed load balancer attribute from the firewall rule to express the correct dependency. Confirm whether the firewall rule follows the allocated address without hardcoded temporary values.
Question 386
A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The infrastructure review requires a supported, least-disruptive Terraform solution. Which proposed change most directly addresses this specific situation?
- Use a resource or data-source precondition where appropriate to enforce the required operational invariant.
- Declare an explicit root output for the required subnet ID and consume that supported interface.
- Define a local value for the normalized naming convention and reference it throughout the module.
- Treat sensitive as output redaction rather than encryption or state omission and protect state plus plan artifacts.
Explanation
Correct Answer
B:The proposed intervention addresses the reported Terraform engineering failure: A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. It applies the design choice Declare an explicit root output for the required subnet ID and consume that supported interface. Review the primary diagnostic: Inspect the module's internal resource address and public outputs. The expected outcome is: Downstream automation receives only the documented subnet identifier. The rollout safeguard is: Avoid exporting sensitive internal values that are not needed.
Incorrect Answers
A:“Use a resource or data-source precondition where appropriate to enforce the required operational invariant” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
C:“Define a local value for the normalized naming convention and reference it throughout the module” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
D:“Treat sensitive as output redaction rather than encryption or state omission and protect state plus plan artifacts” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
Question 387
A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. Before choosing a remedy, the team needs independent evidence of the actual root cause. Which TWO checks most directly test this case? (Select TWO.)
- Inspect name constructions across resource blocks.
- Inspect the module's internal resource address and public outputs.
- Check pipeline lookup of the root output from the intended state owner.
- Inspect the load balancer resource's exported address attribute.
- Check whether the intended network ID already exists in the provider API.
Explanation
Correct Answers
B:This is directly relevant evidence for the reported behavior: Inspect the module's internal resource address and public outputs. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Declare an explicit root output for the required subnet ID and consume that supported interface. The expected confirmation is Downstream automation receives only the documented subnet identifier.
C:This is directly relevant evidence for the reported behavior: Check pipeline lookup of the root output from the intended state owner. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Declare an explicit root output for the required subnet ID and consume that supported interface. The expected confirmation is Downstream automation receives only the documented subnet identifier.
Incorrect Answers
A:“Inspect name constructions across resource blocks” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
D:“Inspect the load balancer resource's exported address attribute” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
E:“Check whether the intended network ID already exists in the provider API” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
Question 388
A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. If this behavior continues without correction, which specific risk is most closely supported by the facts, without assuming harm has already occurred?
- Undeclared cross-module assumptions create brittle integrations and expose internals.
- Sensitive flags alone do not prevent secret persistence in state.
- Manual address copying can create stale rules after replacement.
- Dynamic blocks cannot create arbitrary resource declarations or unsupported block types.
Explanation
Correct Answer
A:The reported condition creates the specific potential exposure: Undeclared cross-module assumptions create brittle integrations and expose internals. A risk is not evidence that every adverse outcome already occurred. Two independent checks can corroborate the assessment. First diagnostic: Inspect the module's internal resource address and public outputs. Second diagnostic: Check pipeline lookup of the root output from the intended state owner.
Incorrect Answers
B:“Sensitive flags alone do not prevent secret persistence in state” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
C:“Manual address copying can create stale rules after replacement” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
D:“Dynamic blocks cannot create arbitrary resource declarations or unsupported block types” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
Question 389
A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. A reviewer asks for BOTH a targeted technical response and a corresponding change-control safeguard. Which TWO actions together meet that requirement? (Select TWO.)
- Introduce moved blocks for existing addresses during a careful migration.
- Write a clear condition message and test unknown values.
- Declare the value ephemeral and consume it only in permitted contexts, rather than persisting it in an ordinary output or resource attribute.
- Avoid exporting sensitive internal values that are not needed.
- Declare an explicit root output for the required subnet ID and consume that supported interface.
Explanation
Correct Answers
D:This is one of the two necessary decisions for a safe design: Avoid exporting sensitive internal values that are not needed. Together the corrective action and its implementation safeguard need to address the recorded condition: A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. Acceptance requires Downstream automation receives only the documented subnet identifier.
E:This is one of the two necessary decisions for a safe design: Declare an explicit root output for the required subnet ID and consume that supported interface. Together the corrective action and its implementation safeguard need to address the recorded condition: A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. Acceptance requires Downstream automation receives only the documented subnet identifier.
Incorrect Answers
A:“Introduce moved blocks for existing addresses during a careful migration” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
B:“Write a clear condition message and test unknown values” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
C:“Declare the value ephemeral and consume it only in permitted contexts, rather than persisting it in an ordinary output or resource attribute” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
Question 390
A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The team has implemented an approved Terraform change. Which observed result most directly confirms that the original requirement is now met, beyond a successful command exit code?
- Resources share the same approved naming pattern.
- The child receives the intended environment value independent of naming coincidence.
- Downstream automation receives only the documented subnet identifier.
- Removing one subnet does not renumber unrelated managed subnet addresses.
Explanation
Correct Answer
C:This is the appropriate measurable post-change acceptance criterion: Downstream automation receives only the documented subnet identifier. A successful Terraform command or a completed change request alone would not demonstrate that outcome. Preserve this control during validation: Avoid exporting sensitive internal values that are not needed.
Incorrect Answers
A:“Resources share the same approved naming pattern” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
B:“The child receives the intended environment value independent of naming coincidence” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.
D:“Removing one subnet does not renumber unrelated managed subnet addresses” would address a different Terraform configuration concern; the source instead describes A root module exposes a subnet ID to a deployment pipeline, but the engineer attempts to read a private nested resource from an unrelated root as though its address were global. The appropriate design is to declare an explicit root output for the required subnet ID and consume that supported interface. Confirm whether downstream automation receives only the documented subnet identifier.