https://pulumi.com logo
#general
Title
# general
i

incalculable-diamond-5088

04/19/2019, 10:33 PM
@white-balloon-205 In https://github.com/pulumi/pulumi-eks/blob/master/nodejs/eks/cluster.ts#L92 - both
instanceRole
and
instanceRoles
are outputs and thus the expression fails even though none of them is set
Seems like it was a problem in my code. Though theoretically it can happen?
w

white-balloon-205

04/19/2019, 11:28 PM
I think the idea is that the caller should only pass a value at all for one or the other. Technically this doesn't support passing
Output<undefined>
for one and
Output<defined>
for the other, but that ideally shouldn't be a common use case.
Curious if @lemon-spoon-91807 or @breezy-hamburger-69619 have thoughts on this general pattern.
l

lemon-spoon-91807

04/19/2019, 11:30 PM
Right. only one should be set. Though i am curious why these are outputs. @breezy-hamburger-69619 In general we discourage Output<Resource>. Is that necessary here?
b

breezy-hamburger-69619

04/19/2019, 11:35 PM
Taking a 2nd look @ it, I don’t believe it is necessary. I adopted the
Output<Resource>
for
instanceRoles
as I found
instanceRole
to be an
Output
so i followed suit. This should be type itself, not outputted
w

white-balloon-205

04/19/2019, 11:37 PM
Input<Resource> is a holdover for an old design pattern here. Hard to change now. But that's a bit orthogonal to the question I was asking (about using
&&
on two "optional Input<T>" arguments). But not a big deal.