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

gorgeous-spoon-23700

11/02/2020, 9:00 AM
hi, I am looking for an easy way to get the current state of a deployment directly from python code. Right now I use a quick and dirty trick by running
pulumi stack export
command and extracting the relevant info from the JSON data:
Copy code
jq = local["/usr/local/bin/jq"]
    pulumi = local["pulumi"]

    chain = pulumi["stack", "export"] | jq['.deployment.resources[] | select(.type == "pulumi:pulumi:Stack") | .outputs.netcams']
    netcams = json.loads(chain())
Should I wait for the python implementation of the Automation API? 😎
r

rough-oxygen-8318

11/06/2020, 6:08 PM
This is going to be really exiting ..... can't wait for the Python Automation API implementation 😁