Destroy a Deployment

Safely destroy deployments and clean up resources using bricks uninstall.

Prerequisites

  • Bluebricks CLI installed

  • Authenticated with Bluebricks (bricks login)

  • Existing deployment to destroy

Quick Start

  1. Uninstall by deployment slug:

    bricks uninstall --deployment my-postgres-db --collection production
  2. Uninstall by package name:

    bricks uninstall @myorg/postgres --collection production
  3. Plan destruction first (recommended):

    bricks uninstall --deployment my-postgres-db --collection production --plan-only
  4. Verify destruction:

    bricks deploy list

What Is Uninstalling?

Uninstalling is the process of:

  • Creating a destroy plan to review resource deletion

  • Removing resources created by the deployment

  • Cleaning up dependencies in reverse order

  • Handling destruction errors safely

  • Verifying cleanup completion

Uninstall Methods

Method 1: Uninstall by Deployment Slug

Method 2: Uninstall by Package Name

Destroy Flow

1. Plan Destruction

Always create a destroy plan first to review what will be deleted:

Review the destruction plan in the web UI:

  • Resources to be destroyed

  • Resources to be updated (e.g., security group rules)

  • Impact on dependent resources

  • Destruction order

2. Review and Approve

After creating the plan:

Option A: Via Web UI

  • Open the plan URL from the CLI output

  • Review all resources to be destroyed

  • Click "Approve" to proceed with destruction

Option B: Auto-approve (not recommended)

3. Verify Destruction

After destruction completes:

Deployment Manifest for Uninstall

You can also use a deployment manifest with spec.planOnly: true:

Then uninstall by deployment slug:

Using GitHub Actions

Automate uninstall operations with the official Bricks GitHub Actionarrow-up-right:

Plan Destruction on PR

Execute Destruction on Approval

Automated Cleanup (Non-Production)

Important Considerations

Data Protection

Always backup critical data before destruction:

  • Export databases

  • Download configuration files

  • Archive important logs

  • Document resource identifiers

Dependency Management

Destroy resources in the correct order:

  • Child deployments first (dependencies)

  • Parent deployments last (dependents)

  • Shared resources last (VPC, networking)

Resource Cleanup

Some resources may not be automatically destroyed:

  • Persistent storage (volumes, snapshots)

  • External DNS records

  • Manual firewall rules

  • Externally created resources

Verify cleanup in cloud console after uninstall.

Best Practices

Always Plan Before Destroy

Verify Destruction

Collection Safety

Development/Staging collections:

  • Can destroy freely

  • Test destruction process

  • Practice disaster recovery

Production collections:

  • Require manual approval

  • Create backup first

  • Verify destruction plan thoroughly

  • Document destruction reason

  • Use GitHub environment protection rules

Common Scenarios

Destroy Single Deployment

Destroy All Deployments for a Package

Destroy with Specific Environment

Failed Destruction Recovery

If destruction fails:

See also

Last updated

Was this helpful?