Operations monitoring
See what's running, what failed, and what's happening across your infrastructure.
Scenarios covered:
I want to destroy all resources in a stack quickly
When to use this
Use this workflow when you:
- Need to tear down an entire environment — dev, staging, a feature branch stack
- Are cleaning up after a demo or experiment — ephemeral infrastructure that's served its purpose
- Want to decommission a project — remove everything in one shot rather than resource by resource
This is a destructive operation. formae will delete every resource in the stack, respecting dependency order automatically (dependents are deleted before their dependencies).
Step-by-step
Before you begin: review the baseline prerequisites and confirm the stack has previously been applied (i.e., there are managed resources to destroy).
Step 1: Check what's in the stack
Before destroying anything, see what you're about to delete:
formae inventory resources --query="stack:my-app"
To see more than the default 10 results:
formae inventory resources --query="stack:my-app" --max-results=100
Tip: Double-check the stack name. Stacks are case-sensitive.
Step 2: Simulate the destruction
Run a dry-run first to see the full destruction plan without executing it:
formae destroy --simulate --query="stack:my-app"
Review the output carefully. Every resource listed will be deleted.
Step 3: Destroy the stack
Once you're confident, run the destroy command with --watch to monitor progress in real time:
formae destroy --watch --query="stack:my-app"
Skip the confirmation prompt
If you're scripting or already sure:
formae destroy --watch --yes --query="stack:my-app"
Destroy using a forma file instead
You can also destroy by pointing at the original forma:
formae destroy --watch my-app.pkl
This destroys resources that match the forma's stack, which is useful when you have the source file handy.
Step 4: Verify cleanup
After the command completes, confirm the stack is empty:
formae inventory resources --query="stack:my-app"
This should return no results. The stack itself is automatically removed once its last resource is deleted.
Tips + gotchas
| Tip | Details |
|---|---|
| Dependency order is automatic | You don't need to worry about ordering. Subnets are deleted before their VPC, instances before their security groups, etc. |
| Partial failures are recoverable | If some deletions fail, re-run the same destroy command. It picks up where it left off. |
Common gotcha: Destroying a stack doesn't remove unmanaged (discovered) resources. Only resources that formae manages within that stack are affected.
What's next
| Goal | Guide |
|---|---|
| Redeploy after cleanup | Formae 101 → Fundamentals |
| Understand stacks | Core Concepts → Stack |
| Monitor command status | CLI → Status |
| Cancel a running command | CLI → Cancel |