def describe_stack()

in aws/cloudformation.py [0:0]


    def describe_stack(self, stack_name):
        describe_res = self._cfn.describe_stacks(StackName=stack_name)

        stacks = describe_res["Stacks"]
        if len(stacks) > 1:
            raise RuntimeError(f"Found more than one stack with name {stack_name}")

        stack_desc = stacks[0]
        status = stack_desc["StackStatus"]

        # cfn outputs an array of maps, each element in the array is
        # a single output of the form "{OutputKey: <key>, OutputValue: <value>}"
        # simplify to a map of <key>, <value>  pairs
        outputs = {}
        if "Outputs" in stack_desc:
            for cfn_output in stack_desc["Outputs"]:
                key = cfn_output["OutputKey"]
                value = cfn_output["OutputValue"]
                outputs[key] = value
        return status, outputs