Network

Destroy Containerlab Stack


Author: Matthew Fernandez

Destroy Containerlab Stack

Tears down everything created by Deploy Containerlab Stack — destroys the running containerlab topology, then deletes the EC2 hypervisor and related AWS resources (VPC, subnet, security group, keypair). Topology teardown is best-effort so hypervisor cleanup still runs if the instance is already gone.

Prerequisites

  • A stack previously deployed with NETWORK ǀ Deploy Containerlab Stack
  • AWS credential configured

Survey prompts

Prompt Variable Type Required
AWS Region clab_aws_region multiplechoice Yes

Options: us-east-2, us-west-2 — use the same region as Deploy.

  1. Teardown Topology — Runs containerlab destroy on the hypervisor (skipped cleanly if no hypervisor is found)
  2. Teardown Hypervisor — Always runs next: terminates the EC2 instance and removes VPC, subnet, security group, and keypair

Job templates

Template Playbook Description
NETWORK ǀ Destroy Containerlab Stack network/setup.yml Workflow that tears down topology then AWS resources
NETWORK ǀ Containerlab ǀ Teardown Topology network/teardown_containerlab.yml Destroys the running containerlab topology
NETWORK ǀ Containerlab ǀ Teardown Hypervisor network/teardown_hypervisor.yml Deletes the EC2 hypervisor and related AWS resources

Presenter walkthrough

  1. When to use: End of a demo session or when you need a clean rebuild. Safe to run if topology teardown is a no-op.
  2. Launch: Select the same AWS region used for Deploy.
  3. Watch always_nodes: Topology teardown feeds hypervisor teardown on the always path so AWS cleanup is not skipped.

See other Network demos

Browse all Network demos →

Workflow

graph LR
  S["🏠 Start"]
  S --> A
  A["📦 Teardown Topology"] -->|always| B["💥 Teardown Hypervisor"]
  style A fill:#4a1a1a,stroke:#ef4444,color:#fff
  style B fill:#4a1a1a,stroke:#ef4444,color:#fff
  style S fill:#212427,stroke:#8a8d90,color:#fff