Skip to main content
ubx terminate tears down a deployed stack. It checks for a prior apply record (from ubx ship) to reuse the compiled artifact. If no record exists, it runs the full compile pipeline first.

Usage

ubx terminate [path] [flags]

Flags

FlagDescription
--forceSkip the confirmation prompt

Examples

ubx terminate                        # destroy current stack (prompts)
ubx terminate --force                # destroy without prompting
ubx terminate ./networking           # destroy a specific directory

What happens

  1. Check apply record — reads .ubx/last-apply.json
    • If found: reuses the artifact_uri and plugin_name (skips compile)
    • If not found: runs the full XCL pipeline (compile → typecheck → IR → plugin Compile)
  2. Confirmation — prompts with resource count unless --force
  3. Plugin Destroy — invokes plugin’s Destroy RPC, streams progress events

Progress output

  ◆ Stack       networking (from last apply)
  ◆ Destroy     running pulumi destroy…

  - aws:ec2:Subnet    networking-public-1b    (3.1s)
  - aws:ec2:Subnet    networking-public-1a    (3.2s)
  - aws:ec2:Vpc       networking-vpc          (4.8s)

  done (11.1s)  ·  3 destroyed

Safety

Without --force, ubx shows:
  This will destroy all resources in stack "networking".

  Destroy? [y/N]
Type y to proceed. Any other input cancels.

After termination

The apply record (.ubx/last-apply.json) is not automatically removed. Run ubx state list to verify the stack is empty.

Exit codes

CodeMeaning
0All resources destroyed
1Compile/typecheck/destroy error; user cancelled