https://pulumi.com logo
Title
a

ambitious-sundown-4188

01/23/2023, 7:43 PM
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

lemon-agent-27707

01/24/2023, 2:54 PM
a

ambitious-sundown-4188

01/24/2023, 6:40 PM
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

lemon-agent-27707

01/24/2023, 6:51 PM
Here is some python code that reads the stack outputs:
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)