https://pulumi.com logo
Title
p

proud-dusk-33872

10/28/2021, 11:54 PM
Separate question: my deployment requires that I perform an action after something has been deployed (eg. call an API endpoint on a webapp after it's deployed) but that action has no explicit return value. How does that work in terms of using Output? Should I still use Output.Apply for the dependency, but just return a dummy value (like bool / Unit) for my custom action?
b

billowy-army-68599

10/29/2021, 12:00 AM
you can just return
true
👍 1
p

proud-dusk-33872

10/29/2021, 12:04 AM
And it's ok that I don't include that Output<bool> in the return result of the caller?
b

billowy-army-68599

10/29/2021, 12:05 AM
yep it should be
p

proud-dusk-33872

10/29/2021, 12:05 AM
Actually one more question to clarify something: by the time, for example, the
new Web.WebApp()
constructor exits has the resource actually been created? Or does that occur later, and I need to use Output.Apply to ensure my dependency on it is called at the right time?
b

billowy-army-68599

10/29/2021, 12:08 AM
little more complex than that. when an
Output.Apply
return, it means the Azure API has returned a value for it, which almost always means the resource has been created There are a few edge cases which I can't recall now, but
Output.Apply(value)
is what you need to use
p

proud-dusk-33872

10/29/2021, 12:08 AM
Got it, thanks. How does all that work in a Dry Run scenario?
(I'm making a side effect call to Azure, and I'm doing that from
WebApp.Name.Apply(x => {})
)
b

billowy-army-68599

10/29/2021, 12:12 AM
you might want to wrap any SDK run with an if statement checking if it's a dry run: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/runtime/#isDryRun
but an Apply shouldn't run anything inside it during a preview
p

proud-dusk-33872

10/29/2021, 12:25 AM
Got it, thanks!