Yevai NPM Packages
    Preparing search index...

    Class CloudStackReferenceV2

    Typed access to outputs from other Pulumi stacks within SST applications.

    Unlike the original CloudStackReference, this version directly queries the Pulumi Cloud backend using the CLI, ensuring access to the most up-to-date stack outputs. Outputs are cached per stack to minimize CLI calls, and stack names resolve across organizations and stages.

    // Reference a stack in the same project, inferring stage
    const appStack = new CloudStackReferenceV2("my-app");

    // Reference a stack with explicit stage
    const dbStack = new CloudStackReferenceV2("database", { stage: "prod" });

    // Reference a fully qualified stack name
    const authStack = new CloudStackReferenceV2("my-org/auth-service/dev");

    // Access outputs
    const apiUrl = appStack.requireOutput<string>("apiUrl");
    const dbConfig = dbStack.getOutput<DbConfig>("config");
    Index
    • Creates a new CloudStackReferenceV2 instance.

      Parameters

      • name: string

        The name of the stack to reference. Can be a short name (e.g., "my-stack") or a fully qualified name (e.g., "org/project/stage").

      • options: { stage?: string } = {}

        Configuration options for the reference.

        • Optionalstage?: string

          The stage to target. Required if using a short stack name, unless implied by the current environment (e.g., PULUMI_STACK).

      Returns CloudStackReferenceV2

      If the Pulumi organization cannot be determined or if required arguments are missing.

    name: string
    organization: string
    outputs: any
    stage: string
    • Retrieves an output value from the referenced stack.

      Type Parameters

      • T = any

        The expected type of the output value. Defaults to any.

      Parameters

      • key: string

        The name of the output to retrieve.

      Returns T | undefined

      The output value typed as T, or undefined if the output does not exist.

    • Retrieves a required output value from the referenced stack.

      Type Parameters

      • T = any

        The expected type of the output value. Defaults to any.

      Parameters

      • key: string

        The name of the output to retrieve.

      Returns T

      The output value typed as T.

      If the output with the specified key does not exist.