How to use `Output` on a Python list? Here's the s...
# general
r
How to use
Output
on a Python list? Here's the sudo code:
Copy code
sns_topics: list[Output] = create_sns_topics()
receivers = []
for topic in sns_topics:
    receiver = {
        "arn": topic.arn
    }
    receivers.append(receiver)

yaml.dump(receivers)
yaml.dump
throws because it cannot handle future objects (from
topic.arn
). I went through the doc on Outputs, but couldn't quite figure out how to use
.apply
on a list
Hmm... I guess I should use
pulumi.Output.json_dumps
instead of
yaml.dump