https://pulumi.com logo
Title
l

little-river-49422

02/06/2019, 8:47 AM
but I have to await it, which kinda suggests this is not something I should be using
w

white-balloon-205

02/06/2019, 4:47 PM
The API design is a little different here - but it is indeed designed to be used. Since the call doesn't have any dependencies - it doesn't need to be an
Output
, so these calls are projected as returning an async function. Not sure if we have any good examples of using these in common patterns in Python. @incalculable-sundown-82514 might know.
l

little-river-49422

02/06/2019, 4:51 PM
so I have to use await? I tried a bunch of examples from SO, with no result. I'm not a python developer so not much experience here, sadly
i

incalculable-sundown-82514

02/06/2019, 6:26 PM
The way that I recommend using these functions is to invoke them in an
async
function and then invoke the function as an invoke for a resource, sort of like this: https://github.com/pulumi/pulumi/blob/6f386567f6a8494853bee8fccdb455b3be1a993b/sdk/python/lib/test/langhost/invoke/__main__.py#L34-L38 You can pass futures (the return value of
async
functions) directly to resource constructors.
l

little-river-49422

02/06/2019, 6:46 PM
ok, trying to comprehend that 😉
ok, that worked, thanks!