Hi everyone, is there a general way to generate st...
# python
s
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
Output.all()
ā€¢ In a python lambda create a dict with the needed structure. and dump it using
yaml.dump
. ā€¢ 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
Output.all()
are error-prone when you have more than a few resources.
b
I think this would help if we implemented it, right? https://github.com/pulumi/pulumi/issues/6003
šŸ’Æ 2
q
I've had a similar experience.. Having a dict would help a lot!
r
You can now use keyword args in
Output.all()
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
b
you rock Komal!
partypus 8bit 1
šŸ™ 1