breezy-butcher-78604
01/12/2021, 1:17 AMconst stackRef = new pulumi.StackReference("vpc/dev");
const subnetIds = stackRef.requireOutput("subnetIds");
given the above, subnetIds
will be of type Output<any>
but I want to be able to loop over the values because I need to create a resource for each subnet. is creating the resources inside an apply()
the only option?
it seems weird not being able to directly access the values since stack outputs should always be known prior to a pulumi up
or preview
right?little-cartoon-10569
01/12/2021, 1:22 AMprivateSubnet1Id
, isolatedSubnet2Id
, etc.breezy-butcher-78604
01/12/2021, 1:26 AMThey won't always been known, since the other stack could be running at the same time. Pulumi has to support this caseah ok, that makes sense
Generally, outputs from StackReferences are used as inputs for other resourcesyeah thats typically what happens for me as well but in this case I need to do a foreach over both subnet IDs and route table IDs which i guess isn't possible without an
apply()
little-cartoon-10569
01/12/2021, 1:27 AMbreezy-butcher-78604
01/12/2021, 1:29 AM