When using parent/child modules to deploy infrastructure, how would you export value from one module to import into another module?
For example, a module dynamically deploys an application instance or virtual machine, and you need the IP address in another module to configure a related DNS record in order to reach the newly deployed application.
- configure an output value in the application module in order to use that value for the DNS module
- preconfigure the IP address as a parameter in the DNS module
- configure the pertinent provider's configuration with a list of possible IP addresses to use
- export the value using terraform export and input the value using terraform input
Answer(s): A
Explanation:
Output values are like the return values of a Terraform module and have several uses such as a child module using those outputs to expose a subset of its resource attributes to a parent module.
Reveal Solution Next Question