hi everyone, I have a use case in which I need to ...
# general
s
hi everyone, I have a use case in which I need to parse a string array to create k8s secret, however the array is dynamic, i.e. depending on some condition, it may contain a predefined list or it may need to join the predefined list with another dynamic list which is pulumi.Output<string []>. I keep getting Output string[] is not compatible with string [] due to missing operator such as push etc. Is there anything that I can "marry" these 2 data types?
p
from what I understand, you probably want to use methods like
.apply
that are available in
pulumi.Output
objects
if you need to modify the Pulumi Output, you cannot directly operate on it (as you said,
Output<string[]>
is not
string[]
)
however, you can transform it within function passed to
apply
method
l
This joins an Outout<string[]> to a string[]:
Copy code
outputStringArray = outputStringArray.apply(oa => oa.concat(stringArray));
s
thanks @little-cartoon-10569
👍 1