Skip to main content
ubx destroy tears down all cloud resources in the current Pulumi stack by running pulumi destroy. The .ubx/ directory must exist — run ubx apply at least once first.

Usage

ubx destroy [flags]

Examples

ubx destroy                  # prompt for confirmation
ubx destroy --force          # skip confirmation prompt
ubx destroy --env prod       # destroy prod stack
ubx destroy --target unit.aws_s3_bucket_v2.assets  # specific resource only

Flags

FlagDescription
--forceSkip confirmation prompt
--env stringTarget environment
--stack stringTarget stack name
--target stringArrayTarget a specific resource (repeatable)

Output

  ◆ Stack      dev

  ─── Destroying ─────────────────────

  -  aws:s3:BucketV2     assets     2s
  -  aws:rds:Instance    db        15s

  ✓  done in 18s · 0 created · 0 changed · 2 destroyed

Confirmation

By default ubx prompts before destroying:
⚠  This will destroy 2 resources in stack "dev".
Continue? [y/N]
Use --force to skip in CI/CD pipelines.
ubx destroy permanently deletes cloud resources. Resources with lifecycle { prevent_destroy = true } will be protected and cause an error.