Hello everyone! Iā€™m having a bit of trouble with c...
# typescript
n
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
Copy code
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
You can do the concatenation inside an apply ā€” something like this should work:
Copy code
const container: pulumi.Input<KeyValuePair[]> = ...
pulumi.output(container).apply(x => {
    return [...x, ...otherArgs];
})
n
thanks Ievi, I will give that a go šŸ™‚