https://pulumi.com logo
#python
Title
s

stocky-hair-65085

01/28/2021, 2:33 PM
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

billowy-army-68599

01/28/2021, 6:14 PM
I think this would help if we implemented it, right? https://github.com/pulumi/pulumi/issues/6003
šŸ’Æ 2
q

quiet-leather-94755

01/29/2021, 6:34 PM
I've had a similar experience.. Having a dict would help a lot!
r

red-match-15116

02/18/2021, 12:01 AM
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

billowy-army-68599

02/18/2021, 12:03 AM
you rock Komal!
partypus 8bit 1
šŸ™ 1