Lookup string in object using outputs #5029
-
Hi, i want to get a subnetid from a object using outputs. The below is working using the value 0. Using this index it takes the
The below object is used:
The below contains the vnet / subnet resource that's referencing the object
My question is when i use outputs can i lookup the subnet by name instead of using the index numbers? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Unfortunately, there is not an optimal way to do this today. Are you looking to get the resource Id of the subnets? One common option is to construct an output like so: output snet1Id string = '${vnet.id}/subnets/snet1' There is a proposal to manage subnets exclusively as child resources instead of an array property on the parent vnet that would make this easier, but no ETA for if/when that would be completed. |
Beta Was this translation helpful? Give feedback.
Unfortunately, there is not an optimal way to do this today. Are you looking to get the resource Id of the subnets? One common option is to construct an output like so:
There is a proposal to manage subnets exclusively as child resources instead of an array property on the parent vnet that would make this easier, but no ETA for if/when that would be completed.