Is there a way to merge outputs into one using typ...
# general
s
Is there a way to merge outputs into one using typescript? I have several outputs that are arrays that I would like to be able to merge all of the values into a single flat array. Since these are outputs things like concat or flat do not work. so I have an out put called foo:
[ 'bar', 'cat'] and one called bar: ['abc,' '123]. that I would like to make into flat: ['bar", "cat", "abc", "123"]
f
can use concat or flat in an output.all ?
s
I don't think there is an all on output, but I can try
p
I think you should be able to do that using pulumi functions that operate on outputs
just as Adrew said,
output.all
should do the trick
(I don’t know how it’s called in TS but there must be a counterpart in every language pulumi supports)
based on the docs:
Copy code
let flat = pulumi.all([foo, bar]).apply(([foo, bar]) => [...foo, ...bar]);
s
oh i see!
going to give it a go
It worked! Thank you so much
👍 1
🙌 1