Hi everyone, is there a general way to generate st...
# python
Hi everyone, is there a general way to generate structured text in pulumi? I have an application running in a Kubernetes container. This application wants it's configuration as a yaml file. The yaml structure needs some input from other pulumi resources (Database Parameters, ...). My current implementation is like this: ā€¢ Pass all the needed resource outputs to
ā€¢ In a python lambda create a dict with the needed structure. and dump it using
. ā€¢ This string is passed to Kubernetes Secret which is mounted into the needed pod. I'm not fully happy with this approach because the numbered arguments in the lambda of
are error-prone when you have more than a few resources.
I think this would help if we implemented it, right? https://github.com/pulumi/pulumi/issues/6003
šŸ’Æ 2
I've had a similar experience.. Having a dict would help a lot!
You can now use keyword args in
to create a dict. This is included in v2.21.0 of the SDK. It is now possible to do the following:
Copy code
Output.all(name=output1, name2=output2).apply(lambda x: x['name'])
šŸ™Œ 4
you rock Komal!
partypus 8bit 1
šŸ™ 1