Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.49 KB

File metadata and controls

28 lines (20 loc) · 1.49 KB

This function finds all outputs in a specific module in the Terraform configuration of the current plan's workspace using the tfconfig/v2 import.

Sentinel Module

This function is contained in the tfconfig-functions.sentinel module.

Declaration

find_outputs_in_module = func(module_address)

Arguments

  • module_address: the address of the module containing outputs to find, given as a string. The root module is represented by "". A module named network called by the root module is represented by "module.network". if that module contained a module named subnets, it would be represented by "module.network.module.subnets".

Common Functions Used

None

What It Returns

This function returns a single flat map of outputs indexed by the address of the module and the name of the output. The map is actually a filtered sub-collection of the tfconfig.outputs collection.

What It Prints

This function does not print anything.

Examples

Here are some examples of calling this function, assuming that the tfconfig-functions.sentinel file that contains it has been imported with the alias config:

allRootModuleOutputs = config.find_outputs_in_module("")

allNetworkOutputs = config.find_outputs_in_module("module.network")