Skip to main content
XCL (eXtensible Configuration Language) is the source language of ubx. It’s a declarative, block-based language inspired by HCL. Files use the .xcl extension.

File structure

A .xcl file contains a sequence of top-level blocks. Multiple .xcl files in the same directory are merged into one compilation unit — the directory is the stack.
// workspace.xcl — workspace-level config
workspace {
  engine  = "pulumi"
  runtime = "python"
}

// stack.xcl — resource declarations
stack mystack {
  vpc = aws.ec2.Vpc {
    cidr_block = input.vpc_cidr
  }
}

// inputs.xcl — input declarations
input mystack {
  vpc_cidr: string = "10.0.0.0/16"
}

// outputs.xcl — output declarations
output mystack {
  vpc_id = vpc.id
}

Top-level blocks

These blocks appear at the top level of a .xcl file:
BlockLabelPurpose
stackIdentifierDeclare cloud resources
inputIdentifierDeclare typed input fields
outputIdentifierDeclare stack outputs
localsIdentifierCompute local values
providerIdentifier (+ optional alias)Configure a cloud provider
workspaceNoneWorkspace-level config
contextIdentifierPer-environment deployment config
importQuoted pathImport existing resources
remoteIdentifierReference remote stack outputs
extendLabelsPer-environment attribute overrides
moveNoneRename a resource without recreating it
interface, policy, test, and check are also top-level blocks. Block labels are bare identifiers; quotes are optional. stack networking and stack "networking" are equivalent (the quotes are stripped). The one exception is import "path", where the quoted string is a resource path, not a label.
module, meta, and data declarations are not top-level — they appear inside a stack body. backend is not a top-level keyword either; it is a nested block inside context, workspace, meta, or remote. See module, meta, data, and backend.

Stack body constructs

Inside a stack name { } body you can write:
  • Resource declarationsname = Type { … } (see resources)
  • Module callsmodule name { source = "…" } (see module)
  • Deploy targetsname = deploy helm { … }
  • GitOps syncname = sync argocd { … }
  • Data lookupsname = data <type> { … } (see data)
  • meta { } — one per stack (see meta)

Keywords

stack     input     output    locals    module    provider
import    workspace context   meta      extend    remote
interface policy    test      check     move      data
deploy    sync      for       when      match     default
try       optional  deprecated as       from      true
false     null

Comments

// Single-line comment

/*
  Multi-line comment
*/

/// Doc comment — attaches to the following declaration