Is there a utility function like the following in ...
# typescript
m
Is there a utility function like the following in the available typescript api?
Copy code
pulumi.json.stringify = (obj: JsonValueWithPotentialOutputsToJsonValue) => Output<string>
The return value here is an Output to a json string where the Output has collected all dependencies discovered while walking the passed object (JsonValueWithOutputs) Edit: just use
pulumi.output(obj).apply(uObj => JSON.stringify(uObj))
as output() deeply unwrapps 🎉 thanks pulumi team (lots of complexity is trivialised in the input/output api for us!)
Infact, does
output()
do this itself (ofc without the stringify) https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/#output
deeply unwrapping nested Input values as necessary
Yes, that works.
pulumi.output(obj).apply(uObj => JSON.stringify(uObj))
l
I wrote a tiny utility that simplifies the common case of having to put many values into a single stringify. It's easy with pulumi.all, but it's very messy and hard to read. This allows you to add multiple outputs, then stringify using them all.