hi all! Is there any way to block program executio...
# general
s
hi all! Is there any way to block program execution until an output value is known? For example if I conditionally wanted to peer a vpc - but only if a VPC of a certain name exists?
Copy code
const inRegionJumpVPC = getVpcOutput({ name: "foo" });
    //Somehow Block here
  if (inRegionJumpVPC) {
    const vpcPeeringConnection = new VpcPeeringConnection(
      `${clusterId}-jumpVpc-peering`,
      {
I know this would be possible with `async`/`await` I’m specifically curious about outputs. The ultimate goal is conditional resource creation in a ComponentResource
i
Hi Brady, take a look at [apply](https://www.pulumi.com/docs/concepts/inputs-outputs/#apply) to create dependencies.
s
You might also be able to add an explicit dependency with
dependsOn
, more details at https://www.pulumi.com/docs/concepts/options/dependson/
s
> You might also be able to add an explicit dependency with
dependsOn
, more details at https://www.pulumi.com/docs/concepts/options/dependson/ unfortunately the vpc in question is not created by pulumi so dependencies can not be used here (
get
function results can not be used as dependencies ) @salmon-account-74572 > Hi Brady, take a look at [apply](https://www.pulumi.com/docs/concepts/inputs-outputs/#apply) to create dependencies. Im not sure how apply can be used to create dependencies here @calm-airplane-91573, all values accessible in an apply block would be strings anot not resources
s
Apologies, I overlooked the fact you’re using a
get
function to look up an existing VPC.