Let's say I want to do something after a resource ...
# dotnet
w
Let's say I want to do something after a resource to get a value that is input to another resource, how do I achieve that? Do I do something like:
Copy code
var someVal = resource1.Id.Apply(id => { return GetSomeValue(); });
var resource2 = new SomeResource("name", SomeArgs({AValue = someVal}));
Am I guaranteed that
someVal
will "resolve" after
resource1
is done or is there another way to do this?
t
If you
Apply
on a property that is resolved only after the resource is created, this should work
w
ok, but is there a more pulumi "idiomatic" way of doing it? Ideally I would like to say something like:
Copy code
var someVal = resource1.AfterDeploy(...);
To be even more concrete. What I would like to do is make a request to a kubernetes app after it has been deployed and then use the response I get as input to another resource (APIM). We are still struggling with some weird 502/503 errors from APIM to kubernetes when APIM is fetching the openapi spec. What we would like to try is that we fetch the open api spec and provide it to the APIM resource so APIM doesn't have to make any request. This way we can have error handling on the 502/503 error in our pulumi code.