Question 570
An operator chooses the mechanism "Module encapsulation" for a Terraform project. Which outcome should this choice support?
Explanation
Correct Answer
The practical result of Module encapsulation, used to keep implementation resources private while exposing a stable input and output interface, is: Modules promote reuse by letting callers depend on documented variables and outputs rather than every internal block. A qualification for this effect is: Changing a module's public interface still requires managing compatibility for callers.
Incorrect Answers
That outcome applies to Module block invocation, intended to compose a reusable infrastructure component into a root configuration, rather than the question's feature Module encapsulation: A module block points at a source and supplies declared input arguments to a child module. Unlike Module block invocation, Module encapsulation is intended to keep implementation resources private while exposing a stable input and output interface, not to compose a reusable infrastructure component into a root configuration.
That outcome applies to Module output composition, intended to wire one module's published result into another module's input, rather than the question's feature Module encapsulation: References such as module.network.vpc_id can supply another module's required variable. Unlike Module output composition, Module encapsulation is intended to keep implementation resources private while exposing a stable input and output interface, not to wire one module's published result into another module's input.
That outcome applies to Multiple instances of one module, intended to deploy a common module separately for several named environments, rather than the question's feature Module encapsulation: for_each on a module block can create a keyed child module instance per entry. Unlike Multiple instances of one module, Module encapsulation is intended to keep implementation resources private while exposing a stable input and output interface, not to deploy a common module separately for several named environments.
That outcome applies to Module provider passing, intended to attach an explicitly selected provider configuration to child module resources, rather than the question's feature Module encapsulation: The providers map lets a module receive the provider instance the caller intends. Unlike Module provider passing, Module encapsulation is intended to keep implementation resources private while exposing a stable input and output interface, not to attach an explicitly selected provider configuration to child module resources.
That outcome applies to Module count meta-argument, intended to optionally instantiate a module based on a count expression, rather than the question's feature Module encapsulation: count on a module block creates zero or more indexed module instances. Unlike Module count meta-argument, Module encapsulation is intended to keep implementation resources private while exposing a stable input and output interface, not to optionally instantiate a module based on a count expression.