I have two modules. Module1 I have no control over how it is made or changes to it. Module2 uses Module1 and outputs some values from itself and form Module1.
I am trying to find a way to passthrough the values from Module1 through Module2 in an agnostic fashion.
This is what I mean:
Module1.bicep
//I have no control over this module and the changes made here
output One string = 'One'
output Two string = 'Two'
Module2.bicep
module module1 'Module1.bicep' = {
name: 'Module1'
}
output Three string = 'Three'
output Foour string = 'Four'
//I would like to pass through the outputs of module 1
//This doesnt work!
//output Module1 object = module1.outputs
//This works. But I would like to not change this if Module 1 changes
output Module1 object = {
One: module1.outputs.One
Two: module1.outputs.Two
}
Is there a way to abstract the output of Module1 though Module2 without having to list and group all outputs into an object?
Thanks.
2
Answers
What’s wrong with simply accessing the individual outputs from
Module1
in yourModule2
file like so?Alternatively, you could try:
output Module1 array = module1.outputs
(Not tried that, though!)
I am using this successfully:
You may just need to drill down to
.value
when accessing the values, e.g.Module2.outputs.Module1.One.value
.