flat-insurance-25294
01/04/2020, 10:27 PMpulumi.Output*<*string[]*>*
into a pulumi.Input*<*string*>[]*
?white-balloon-205
q: Output<Output<string>[]>
which is probably not what you want.
If you can share the context of how you are trying to use this - there is frequently an alternative way to structure things that can avoid the need to know the length of the array promptly.flat-insurance-25294
01/05/2020, 1:17 AMaws.route53.Record
It expects
Output<string>[]
while I have
Output<string[]>
Can I assume in the future that they will work interchangeably or is this just a fluke?Output<string[]>
would work with something that expects Input<string>[]
Notice the distinction, one is a promise of Array<String> the other is Array of Promises containing String.white-balloon-205
records
input is of type Input<Input<string>[]>
which accepts an Output<string[]>
.
https://github.com/pulumi/pulumi-aws/blob/master/sdk/nodejs/route53/record.ts#L381Input<>
on the outside. That is why.flat-insurance-25294
01/05/2020, 2:21 AMwhite-balloon-205
flat-insurance-25294
01/05/2020, 2:24 AMArray<Promise<String>>
But I hand it an Promise<Array<String>
They are different, but I am sure you tackle it somehow, but from a type safety point of view, I don’t think it’s sound.white-balloon-205
Array<Promise<string>>
. (Technically that is one valid thing it accepts, but it accepts many others including Promise<Array<string>>
. If you expand out both Inputs into each of the three options in the Union you get a total of 9 options, one of them is exactly the thing you have.Input<Input<string>[]>
flat-insurance-25294
01/05/2020, 2:29 AMwhite-balloon-205
flat-insurance-25294
01/08/2020, 4:57 PM