This message was deleted.
# general
s
This message was deleted.
b
c
but how? I was trying to in that way:
Copy code
output_map_new = output_map.apply(
    lambda output_map: output_map
)
print(output_map_new)
output_map_new2 = pulumi.Output.concat(output_map)
print(output_map_new2)

output_map_new3 = output_map.apply(lambda v: print(v))
print(output_map_new3)
output_map_new, output_map_new2, output_map_new3 return <class 'pulumi.output.Output'>
s
You can't print outputs, because they are deferred like a promise. So when your print is called the value still hasn't been computed
What do you want to actually do with the data? Like write a file or something?
c
I would like to use for loop on my output as I described before:
Copy code
output_map = network_state.get_output('output_map')
for key, properties in output_map.items():
    pulumi_provider1(key, properties['value1'])
    pulumi_provider2(key, properties['value2'])
    ...
Data which are in this dict are passed to functions
s
can you gist what
output_map
looks like?
as it’s exported
c
@sparse-state-34229 I would like to create some resources for every domain
Copy code
{
    "<http://domain1.com|domain1.com>": {
        "frontend_port": 443.0,
        "bandwidth": 100.0,
        "backend_port": 10001,
	"key1": "value1",
	"key2: "value2"
    },
    "<http://domain2.eu|domain2.eu>": {
        "frontend_port": 443.0,
        "bandwidth": 100.0,
        "backend_port": 10002,
	"key1": "value1",
	"key2: "value2"
    },
    "<http://domain3.com|domain3.com>": {
        "frontend_port": 443.0,
        "bandwidth": 50,
        "backend_port": 10003,
	"key1": "value1",
	"key2: "value2"
    },
}
106 Views