gorgeous-country-43026
06/22/2021, 9:04 AMOutput
abstraction is not a trivial task and I would assume Pulumi is actually under the hood generating YAML anyway from the definitions it would make sense if one could also export that data out somehow.
However, I think this is not possible since as far as I can see it, Pulumi automatically registers a resource to state when you say new <resourcetype
and you can't override this functionality, right?
If the answer to my question is what I think it is then my follow up question is: is there a ready tool or library function that could take in TypeScript data (objects, arrays etc) with Pulumi Output
and it would return a valid YAML string with Output
values properly populated?
If the answer to that one is "no" then I have one additional question: how can I reliably generate a string dynamically recursively in such a way that Output
objects are handled correctly? I actually wrote this simple "data to YAML" converter where I tried to handle the Output
objects correctly but unfortunately it doesn't seem to work that well...billowy-army-68599
06/22/2021, 9:31 AMrenderYamlToDirectory
on the provider:
https://www.pulumi.com/docs/reference/pkg/kubernetes/provider/#renderyamltodirectory_gogorgeous-country-43026
06/22/2021, 9:38 AMOutput<string>
which I would prefer in this case.apply
for the `Output`s I need...stocky-spoon-28903
06/23/2021, 3:03 PMgorgeous-country-43026
06/29/2021, 5:53 AMOutput
objects involved it isn't anymore. Let's assume I have a longish data structure with tens of Outputs. The only way I can think of that this could be done is to list all of the Outputs in pulumi.all
and then use that to apply the values at the same time and then return the result. To me this feels messy and hard to read. I would much prefer that I could just place the Output values directly into the data structure where they belong to and call a single function to evaluate it in such a way that all Outputs within it are realized. Then I could just serialize that to YAML without issuesstocky-spoon-28903
06/29/2021, 1:02 PMconst manifest = pulumi.output({
key: valueThatIsOutput,
nested: {
key2: âprompt valueâ,
key3: valueThatIsOutput
},
}).apply(JSON.stringify)
gorgeous-country-43026
06/30/2021, 7:01 AM