https://pulumi.com logo
Title
n

numerous-psychiatrist-20856

10/13/2020, 7:34 AM
Hello everyone! I’m having a bit of trouble with concatenating two arrays of key value pairs. The container definition already has environment vars defined as
pulumi.Input<KeyValuePair[]>
and also want to add some extra variables to that array, but not sure how to correctly work with the input types to be able to concat two arrays at the end
g

gorgeous-egg-16927

10/13/2020, 4:48 PM
You can do the concatenation inside an apply — something like this should work:
const container: pulumi.Input<KeyValuePair[]> = ...
pulumi.output(container).apply(x => {
    return [...x, ...otherArgs];
})
n

numerous-psychiatrist-20856

10/14/2020, 6:50 AM
thanks Ievi, I will give that a go šŸ™‚