is there a way to have an output inside of an `asy...
# general
b
is there a way to have an output inside of an
async
block? i tried doing
Copy code
export let output;
async function doAsyncStuff(() => {
  ...
  output = `${someResource.ingressHost}`;
});
doAsyncStuff().then(() => console.log(output));
the console.log prints `output`'s value in the diagnostics, but for whatever reason i don't get an actual stack output.
t
You should probably return a value from
doAsyncStuff
and assign it to
output
.
Copy code
export let output = doAsyncStuff();
async function doAsyncStuff(() => {
  ...
  return`${someResource.ingressHost}`;
});
Otherwise you might read
output
before it's ready.
b
ah, so an output can be a promise, and that promise's resolve value will be the value of the output?
t
yes. You can also wrap a promise into
pulumi.output
if you need to use it for inputs to other resources.