pulumi.DependsOn only declares a dependency betwee...
# general
b
pulumi.DependsOn only declares a dependency between pulumi resources. Is there a way to declare a dependency on Pulumi outputs?
l
Can you give an example of what you'd like to have happen?
Outputs have a full list of dependencies built in (that's what's special about them compared to promises). Let's figure out how to get your dependency into the output.
b
Copy code
resource1 := NewResource(...)
output2 := resource1.output1.ApplyT(func(s) bool { 
    // make API calls to external service
    return true
  }
resource2 := NewResource(..., pulumi.DependsOn(output2))
                                                ^ arg requires pulumi.Resource
that's the pseudocode for what I'd like to do
@little-cartoon-10569 sorry to resurrect a week old thread. any ideas here?
l
Any reason that you can't depend on resource1?
Also, I would write that without the explicit dependency, and put it all inline, with the resource2 constructor having the apply directly in it. I don't know if having the dependency directly on the property works differently that having it on the entire resource, but it's worth trying.
I know that they're represented differently in the state file. Maybe that would resolve the problem.
b
resource2 constructor is not something I control. But yeah I'll see if I can get creative