-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResourceOptions.dependsOn only accepts Resources and not Output<Resource> #991
Comments
I just ran in to this. Assumed it would work, but got scolded by tsc. I ran in to this because I was using another Output's apply method to get a parameter for a resource. |
Also just figured out a workaround: Use another |
Now that I have a bit more experience, a warning for onlookers: Additional apply calls makes |
Here's another workaround that depends on internals: let outputDeps = <T>(output: pulumi.Output<T>) => {
return (<any>output).resources() as Iterable<pulumi.Resource>;
}; You can use it like: {dependsOn: [...outputDeps(someOutput)]} |
This changes the input type for dependsOn from simply `Resource[] | Resource` to `Input<Input<Resource>[]> | Input<Resource>`. This permits `Output<Resource>`s, etc in addition to `Promise<Resource>`s. The logic for dynamically unpicking the right types and recursing through the data structures isn't straightforward, but I've written a test for all of the interesting permutations. This fixes #991.
This changes the input type for dependsOn from simply `Resource[] | Resource` to `Input<Input<Resource>[]> | Input<Resource>`. This permits `Output<Resource>`s, etc in addition to `Promise<Resource>`s. The logic for dynamically unpicking the right types and recursing through the data structures isn't straightforward, but I've written a test for all of the interesting permutations. This fixes #991.
This changes the input type for dependsOn from simply `Resource[] | Resource` to `Input<Input<Resource>[]> | Input<Resource>`. This permits `Output<Resource>`s, etc in addition to `Promise<Resource>`s. The logic for dynamically unpicking the right types and recursing through the data structures isn't straightforward, but I've written a test for all of the interesting permutations. This fixes #991.
Working through the issues in pulumi/pulumi-cloud#404 discovered that it's not possible to use
Output<Resource>
withdependsOn
, since there is no way to get anOutput
's list of resource dependencies. We may want to consider allowingOutput<Resource>
fordependsOn
so that this works correctly.The text was updated successfully, but these errors were encountered: