Skip to main content
The component block references a reusable Pulumi ComponentResource — from the Strata registry or a local path. Equivalent to Terraform’s module block.

Syntax

component "name" {
  source  = "registry.ubiquex.io/eks-platform"
  version = "2.1.0"
  # component inputs follow
}
  • name — unique name within the stack
  • source — registry path or local directory (required)
  • version — semver (registry only, optional, defaults to "latest")

Registry Component

component "platform" {
  source     = "registry.ubiquex.io/eks-platform"
  version    = "2.1.0"
  region     = "eu-west-1"
  node_count = 3
}

output "cluster_endpoint" {
  value = ~component.platform.cluster_endpoint
}

Local Component

component "vpc" {
  source = "./components/vpc"
  cidr   = "10.0.0.0/16"
  region = input.region
}

unit "aws_subnet" "app" {
  vpc_id = ~component.vpc.vpc_id
}

Referencing Outputs

Component outputs are always Pending<T>:
deploy "helm" "backend" {
  chart  = "my-backend"
  values = {
    cluster = ~component.platform.cluster_endpoint
  }
}

for_each

component "regional_cluster" {
  for_each = { "eu-west-1" = "primary", "us-east-1" = "secondary" }
  source   = "registry.ubiquex.io/eks-platform"
  version  = "1.0.0"
  region   = each.key
  role     = each.value
}

when

input "enable_monitoring" { default = "true" }

component "monitoring" {
  source  = "registry.ubiquex.io/datadog-agent"
  version = "3.0.0"
  when    = input.enable_monitoring == "true"
}

Source Formats

FormatExample
Short formeks-platformregistry.ubiquex.io/eks-platform
Full registryregistry.ubiquex.io/package-name
Local path./components/vpc
Other registrymy-registry.io/package-name

Generated TypeScript

// ubx:dep @ubiquex/eks-platform 2.1.0
import { EksPlatform } from "@ubiquex/eks-platform";

const platform = new EksPlatform("platform", {
    region: "eu-west-1",
    nodeCount: 3,
});