This message was deleted.
s
This message was deleted.
m
some parts arent' accepting outputs, like:
certificateArn:
expects OutputInstance, not Output.. i'm lost..
l
There is an unexported function that does it. To get access to it, add this to your .ts file:
Copy code
declare module '@pulumi/pulumi' {
  export interface OutputInstance<T> {
    promise(withUnknowns?: boolean): Promise<T>;
  }
}
g
Keeping both can be quite confusing. But you should go the other way around.
Output
objects wraps values that might be unknown when your code is executing, there is nothing to await there.
l
OutputInstance is an Output... where is that code?
Generally, those sort of parameters should in Inputs, not OutputInstances... that might be a bug?
g
Forcefully unwrapping an Output is a bad idea. It is unexported for a reason
l
I use it in test code quite a bit, it works well with ChaiAsPromised.
Since there's no provider behind it, it's just unit test code, it's no problem. The only thing it's ever hiding is already available, like outputs that are wrapping inputs to the test objects.
g
@mammoth-caravan-51104 resource inputs should all be types as `Input`s What resource and what provider is that
certificateArn
from?
🙏 1
☝️ 1
m
well, looks like i overlooked something 🤦 issue was coming from here: https://github.com/pulumi/pulumi-awsx/blob/v0.22.0/nodejs/awsx/lb/application.ts#L576 – but the type is correct:
pulumi.Input<string>
. for whatever reason i am getting wrong types suggestions in my editor... but when i run the program, all good!
g
You have a promise to an output, not an
Output<string>
or a
Promise<string>
How did you get that?
🙏 1
You can (probably) await on that promise to get the
Output<string>
that it resolves to or pass that to
pulumi.output
to put another
Output
around it. It will cascade through the
Promise
and the inner
Output
m
well, good point. thanks for pointing that out. it was a chain on confusion starting with
aws.route53.getZone
returning a promise. based on that i built some async functions that were supposed to be returning promises as well. so i ended up wrapping output results in promises.. right now i refactored the code, so it's just handling this one
getZone
promise without the need to create async functions. now i'm simply returning pulumi outputs from my functions and all is good!