https://pulumi.com logo
Title
c

cold-motherboard-287

07/01/2021, 4:46 PM
What would be the recommended pattern to have
async
"things" happening inside of a ComponentResource? I need to use await and inside of the constructor, AFAIK, is not possible.
b

brave-planet-10645

07/01/2021, 5:21 PM
I've had success wrapping the awaited call in
pulumi.output()
(instead of await)
it'll convert it to an output, but that's one way of doing it
Also, promises will still work
c

cold-motherboard-287

07/01/2021, 7:40 PM
that doesn't work for me... I need to get a parameter from AWS' parameter store and then use it as a parameter to look for an EKS instance. But the
getCluster
API requires a
string
and not an
Output<string>
I've seen some patterns like having a promise field in the ComponentResource and then do
const r = new MyResource();
await r.ready
it's suboptimal... but seems to be the most reasonably way