0

I'd like to add an "output property" to my Pulumi program, which is written in Python. But I cannot find a snippet or example of how to do that.

What is the method or syntax for exposing an output property of a Python-based Pulumi program?

Chris Smith
  • 18,244
  • 13
  • 59
  • 81

1 Answers1

0

The __main__.py file, that is the heart of your Pulumi program can use the pulumi.export method.

For example:

import pulumi

import infra

pulumi.export('group', infra.group)
pulumi.export('server', infra.server)
pulumi.export('publicIp', infra.server.public_ip)
pulumi.export('publicHostName', infra.server.public_dns)
Chris Smith
  • 18,244
  • 13
  • 59
  • 81