https://pulumi.com logo
Title
s

salmon-energy-31764

01/26/2023, 8:14 AM
Oh nevermind, looks like I need to convert Output->Token or Promise->Output->Token
export declare type Input<T> = T | Promise<T> | OutputInstance<T>;
w

white-balloon-205

01/26/2023, 2:20 PM
Yes - Pulumi fundamentally works with Outputs, and those are what can be mapped to and from tokens in the CDK bridge. Inputs are just a union that can be an Output<T> or T.
m

miniature-musician-31262

02/01/2023, 10:07 PM
Had this same question myself today. The first thing I tried was passing the input to`asString()` — maybe that could accept inputs directly? That might be a bit more ergonomic than having to wrap the input in an output with
this.asOutput(pulumi.output(myInput))
. Happy to file an issue if y’all would agree with that.
w

white-balloon-205

02/02/2023, 12:42 AM
Yes - that should be possible - and indeed would make this function a little more convenient to use. It's actually important that it not wrap the input in
pulumi.output
though, since that will result in an opaque token even for "known" values. It will need to type test the input and emit a plain old string value if it gets a
string
.
m

miniature-musician-31262

02/02/2023, 1:09 AM
Ah I see, yeah that makes sense.