Skip to main content
The remote block declares a reference to another ubx stack. Its outputs are accessed via ~@name.output syntax.

Syntax

remote "name" {
  source = "github.com/org/repo//stacks/networking"
  stack  = "${input.env}"
}

Fields

FieldRequiredDescription
sourceyesGitHub repo path to the stack directory
stacknoPulumi stack name (defaults to defaultEnv)

Example

# Declare reference to networking stack
remote "networking" {
  source = "github.com/myorg/platform//stacks/networking"
  stack  = "${input.env}"
}

# Use its outputs with ~@name.output
unit "aws_subnet" "app" {
  vpc_id            = ~@networking.vpc_id
  availability_zone = "eu-west-1a"
  cidr_block        = cidrsubnet(~@networking.vpc_cidr, 8, 1)
}

Reference Syntax

~@remote_name.output_name
Cross-stack references are always Pending<T>.

Workspace Usage

remote blocks are typically declared alongside a workspace block for multi-stack orchestration:
workspace "platform" {
  stack "networking" {
    path = "./stacks/networking"
  }
  stack "apps" {
    path       = "./stacks/apps"
    depends_on = ["networking"]
  }
}

remote "networking" {
  source = "./stacks/networking"
  stack  = input.env
}

Generated TypeScript

const networking = new pulumi.StackReference(
  `myorg/networking/${env}`
);

// ~@networking.vpc_id
const app = new aws.ec2.Subnet("app", {
    vpcId: networking.getOutput("vpc_id"),
});