Hey everyone, I want to create a def(python) to ge...
# automation-api
a
Hey everyone, I want to create a def(python) to get the value from a created stack to access them in a fastApi webservice. Any any idea?
l
a
I want to create pulumi automation stacks via FastApi Post webservice in Azure. Been able to do it. Now I want to get the values or outputs from the first stack created and use them in a webservice to see the information. I read the documentation on stack reference and outputs, but I am still don t get it.
l
Here is some python code that reads the stack outputs:
Copy code
stack = auto.select_stack(stack_name=stack_name,
                                  project_name=project_name,
                                  # no-op program, just to get outputs
                                  program=lambda *args: None)
        outs = stack.outputs()
        return jsonify(id=stack_name, url=outs["website_url"].value)