Skip to main content
ubx validate runs the full compiler pipeline without generating TypeScript or deploying. Fast — no cloud credentials required.

Usage

ubx validate [path] [flags]

Examples

ubx validate                   # all .iac in current directory
ubx validate main.iac          # specific file
ubx validate ./stacks/net      # specific directory
ubx validate --compile         # also run tsc --noEmit
ubx validate --cost            # check cost_limit (requires AI)
ubx validate --env prod        # with environment overrides

Flags

FlagDescription
--compileAlso run tsc --noEmit on generated TypeScript
--costCheck cost_limit attributes against AI cost estimates
--env stringTarget environment
--stack stringTarget stack name

Output

Success:
  ◆ Compile    stack.iac
  ✓  valid
With errors:
  ◆ Compile    stack.iac

  ✗  stack.iac:3  required attribute "engine" is missing from unit "db" (aws_rds_instance)
  ✗  stack.iac:7  unknown attribute "fake_field" on aws_s3_bucket_v2

  ✗  2 error(s)
With warnings:
  ◆ Compile    stack.iac

  ⚠  stack.iac:5  attribute "acl" is not a known field of aws_s3_bucket_v2
  ✓  valid  (1 warning(s))

What Gets Validated

  • Syntax — valid .iac block structure
  • Required fields — all required provider attributes present
  • Unknown fields — warn on attributes not in schema
  • References — all ~unit.x.y.z, local.name, input.name refs exist
  • Circular dependencies — detected and reported
  • Policy blocks — all policy rules evaluated
  • cost_limit — validated with AI when --cost is set

--compile Flag

Runs tsc --noEmit after schema validation. Requires Node.js.
  ◆ Compile    stack.iac
  ✓  valid

  ◆ TypeScript compiling generated code...
  ✓  TypeScript valid

Exit Codes

CodeMeaning
0Valid (warnings don’t fail)
1One or more errors