-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document
dependsOn
workarounds for invokes (#12327)
* Document `dependsOn` workarounds for invokes Invokes, or provider functions, are exposed in many SDKs alongside resources, and allow programs to call arbitrary provider-specific APIs. Just as resources may be passed resource options, so may invokes be passed invoke options, with the usual suspects such as `parent` and `provider` making an appearance and appearing as one might expect. One resource option that is currently not available as an invoke option, despite appearing a natural addition, is `dependsOn`, which allows Pulumi users to make explicit dependencies and ordering constraints in their programs that Pulumi cannot otherwise track. One reason that `dependsOn` does not currently exist as an invoke option is that any given invoke can be called in one of two ways: * A "direct form", whereby the function accepts plain arguments and either blocks until it returns a value or returns a language-native asynchronous value (such as a `Promise` in NodeJS or a `Task` in Python, for instance). * An "output form", whereby the function accepts any Pulumi `Input` values and returns a Pulumi `Output` value. Since direct-form invocations do not use Pulumi `Input`s or `Output`s, they do not form part of the Pulumi dependency graph. Passing `dependsOn` to a direct-form invocation would therefore make no sense. The sharing of the set of invoke options between the two forms means that `dependsOn` is consequently not currently available. Thankfully, one can work around the absence of `dependsOn` for output-form invocations using e.g. `pulumi.all` and `.apply`. This commit updates the documentation on invokes/provider functions to (hopefully) make this clear and provide examples where possible. While we are here we also bolster some of the other pieces of documentation on provider functions, such as defining the terms "direct form" and "output form" which are already referenced on other pages. Fixes pulumi/pulumi#14243 Co-authored-by: Christian Nunciato <[email protected]>
- Loading branch information
Showing
1 changed file
with
156 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters