This message was deleted.
# typescript
s
This message was deleted.
g
Two ways to do it: • Make a constructor that takes the responses, not the ids, and a static async method. The boring way • Wrap the responses in
pulumi.output
and treat them as any pulumi resource, manipulating using
.apply(...)
l
Thanks. I didn't know you could wrap a Promise with
pulumi.output
and use apply in the normal way, that's useful. I do the opposite in my tests all the time, I should have guessed!
I think I'll go with your first option though: a little rework allows me to pass the Vpc in from the project, and later I'll be able to switch to using StackReferences, like I should. (Can't do that yet because of our chosen backend solution.)
g
I personally prefer to have all my inputs types as
pulumi.Input<something>
and then use it with
pulumi.output
, this my functions and constructors accepts resource outputs, promises and raw values at any time
👍 1
l
Good idea. Makes it slightly more verbose in the unit tests: we put 99% of code in ComponentResources and unit test them, so the overhead is noticeable. But it's worth it, I think. Certainly worth doing for new classes.