CLI
destroy

destroy

Destroy a deployment and remove all associated resources.

Usage

onvera destroy <deployment_id> [--force]

Arguments

  • <deployment_id> - Deployment ID to destroy

Flags

  • --force - Skip confirmation prompt

Description

The destroy command initiates destruction of a deployment. This operation:

  1. Revokes user access
  2. Removes database tenant
  3. Tears down infrastructure resources
  4. Deletes the deployment record

Destruction is processed asynchronously. The command polls for completion and exits when destruction succeeds or fails.

⚠️

This operation is irreversible. All data and resources associated with the deployment will be permanently deleted.

Examples

Destroy with confirmation:

onvera destroy dep_550e8400-e29b-41d4-a716-446655440000

Destroy without confirmation:

onvera destroy dep_550e8400-e29b-41d4-a716-446655440000 --force

Output

Confirmation prompt:

Are you sure you want to destroy deployment dep_550e8400-e29b-41d4-a716-446655440000? (y/N): 

During destruction:

Destroying deployment dep_550e8400-e29b-41d4-a716-446655440000...
Operation ID: op_770e8400-e29b-41d4-a716-446655440002
Polling for completion...
Press Ctrl+C to stop polling (destruction will continue)
Status: revoking_access - Revoking user access (15s elapsed)
Status: removing_db_tenant - Removing database tenant (45s elapsed)
Status: tearing_down_infra - Tearing down infrastructure (2m 14s elapsed)
Status: succeeded - Destruction complete (3m 32s elapsed)

Destruction succeeded!

Interrupting Polling

💡

You can press Ctrl+C to stop polling. The destruction continues in the background. Use the Operation ID to check status later:

onvera ops get op_770e8400-e29b-41d4-a716-446655440002

Common Failure Modes

Not authenticated

Error:

not authenticated. Run 'onvera auth login' first

Solution: Run onvera auth login to authenticate.

Deployment not found

Error:

API error: Deployment not found

Solution: Verify the deployment ID is correct and that you have access to it.

Destruction fails

If destruction fails, check the operation status:

onvera ops get <operation_id>

The operation will include error details in the progress message.

Related Commands

  • deploy - Create a deployment
  • ls - List all deployments
  • ops - Manage operations