is it possible to run a code block based on `depen...
# python
is it possible to run a code block based on
the way i can use
for funcitons that accept
i would love to also know this. Currently, I just pick an Output on the resource the resolves at the right time and use the
to call that code
i'm still pretty new to pulumi, would you mind providing an example of what you just described?
Outputs are the future/promise/deferred/etc of pulumi
is the basic "call this function when you have a value"
it gets passed the resolved value, but technically it doesn't have to use it
so i've used it in the past like:
Copy code
wait_on = 
dev = pulumi_tailscale.get_device_output(
    hostname=wait_on.apply(lambda _: name),
i'm in azure, so
is generally the azure-assigned resource ID that only resolves after the resource has been created
as opposed to something like
, which every pulumi resource has, regardless of provider, but resolves as soon as pulumi starts creating the resource
awesome, thanks for the details!
some caveats: • If you're just doing data transformations (eg, taking results from one resource, doing string operations, and handing it to a pulumi resource or function), you can just use
and return the values you're producing. Those methods produce an Output that can be handed to pretty much anything pulumi. • I think the functions within
might not be called, depending on the specifics. Using the value (eg,
) will ensure it'll definitely be called when the state is applied, but I expect the specifics are .... fuzzy • The functions passed to `.apply()`/etc might be called multiple times, eg during the preview and then applying. Again, the specifics are probably complicated.