little-whale-73288
11/05/2021, 3:03 PMaws.lb.ListenerRule
to the ones set on an aws.lb.TargetGroup
like:
new aws.lb.ListenerRule(name, {[...], tags: tg.tags})
but I am getting:
error TS2322: Type 'Output<{ [key: string]: string; } | undefined>' is not assignable to type 'Input<{ [key: string]: Input<string>; }> | undefined'.
Type 'OutputInstance<{ [key: string]: string; } | undefined>' is not assignable to type 'Input<{ [key: string]: Input<string>; }> | undefined'.
Type 'OutputInstance<{ [key: string]: string; } | undefined>' is not assignable to type 'OutputInstance<{ [key: string]: Input<string>; }>'.
Type '{ [key: string]: string; } | undefined' is not assignable to type '{ [key: string]: Input<string>; }'.
Type 'undefined' is not assignable to type '{ [key: string]: Input<string>; }'.
am I missing something obvious or should this just work?witty-candle-66007
11/05/2021, 3:11 PMtg.tags
is undefined. Is that the tags property from the TargetGroup?little-whale-73288
11/05/2021, 3:12 PMlittle-whale-73288
11/05/2021, 3:13 PMlittle-whale-73288
11/05/2021, 3:13 PMwitty-candle-66007
11/05/2021, 3:19 PMtags = {"goo":"foo"}
and then assign that to the tags input for the TargetGroup and Listener resources.little-whale-73288
11/05/2021, 3:19 PM// <https://pulumi-community.slack.com/archives/CJ909TL6P/p1636124629078600>
export function tagsOutput2Input(
tags: pulumi.Output<{ [key: string]: string } | undefined>
): pulumi.Input<{ [key: string]: pulumi.Input<string> }> | undefined {
if (tags === undefined) {
return undefined
}
const dTags = tags as pulumi.Output<{ [key: string]: string }>
return Object.keys(dTags).reduce(
(result, name) => ({
...result,
[name]: dTags[name],
}),
{}
)
}
little-whale-73288
11/05/2021, 3:21 PMlittle-whale-73288
11/05/2021, 3:21 PMexport function tagsOutput2Input(
tags: pulumi.Output<{ [key: string]: string } | undefined>
): pulumi.Input<{ [key: string]: pulumi.Input<string> }> | undefined {
if (tags === undefined) {
return undefined
}
return tags as pulumi.Output<{ [key: string]: string }>
}
witty-candle-66007
11/05/2021, 3:22 PMlittle-whale-73288
11/05/2021, 3:24 PMlittle-cartoon-10569
11/05/2021, 8:47 PMtags: pulumi.output(tg.tags)
too. It's still a workaround and shouldn't be necessary, but at least it's easier to read.little-whale-73288
11/06/2021, 11:02 AMerror TS2322: Type 'Output<UnwrappedObject<{ [key: string]: string; }> | undefined>' is not assignable to type 'Input<{ [key: string]: Input<string>; }> | undefined'.