How does one get outputs from dynamic module outputs #5460
-
The docs here indicate that if I'm deploying a loop over a collection of resources, there's a path forward to capture the output of each deployment in a way that the module itself can emit the outputs. The next section in the docs indicate how to get the output from a singular module deployment, which leads me to my current ask - how might I output from a collection of module deployments? I have Bicep deploying a collection of modules as in the following:
Each of these deployments outputs a string value via:
I would like to follow it with something like the following:
Unfortunately, I'm getting red squigglies in VS Code under the "MyDeployment" reading "Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression." Is what I'm trying to do here possible (yet)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can always iterate over the same list that was used to execute the module loop. e.g. module MyDeployment './myModule.bicep' = [for (dep, index) in deployments: { // <-- same
name: 'deployment-${index}'
}]
output DeploymentFQDNs array = [for (dep, index) in deployments: { // <-- same
FQDN: MyDeployment[index].outputs.FQDN
}] Add docs link as well: https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/loops#integer-index |
Beta Was this translation helpful? Give feedback.
@WhitWaldo
You can always iterate over the same list that was used to execute the module loop.
e.g.
Add docs link as well: https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/loops#integer-index