Skip to main content
Destructive command. This permanently deletes AWS resources. Back up data first.

Overview

fjall destroy <app> deletes the AWS resources for one application, in reverse dependency order. The positional argument is application-only. Tier teardown uses noun-verb commands instead: fjall org destroy, fjall platform destroy, fjall account destroy. Passing organisation, platform, account or domain as the positional fails before authentication with a teaching error naming the right spelling. Nothing is validated and nothing is destroyed:

Prerequisites

Without the infrastructure file, destroy stops with No infrastructure.ts found and does no AWS work.

Usage

Destroy an application

Fjall deletes the application’s CloudFormation stacks in this order, skipping stacks the application does not declare: Compute goes before the database, and the network stack goes last, so nothing is deleted while a dependent stack still references it.

What survives the destroy

Removal policies come from the target account’s environment, not from a flag on the command. Accounts stamped production default to RETAIN, so their data resources outlive the stack delete. Every other stage (staging, development, platform, compliance) defaults to DESTROY. Check which account a target maps to with fjall target list before you destroy anything in a staging or development account.

Tear down tier infrastructure

Tier teardown is noun-verb. Each command registers only the flags its tier honours.

Cascade control

fjall org destroy cascades by default, tearing down every member account first, then the platform, then the organisation stack:
Pass --no-cascade to destroy the organisation stack alone:
--no-cascade exists on fjall org destroy only. fjall destroy, fjall platform destroy and fjall account destroy reject it as an unknown option, and neither the platform nor the account teardown ever cascades.

Interactive flow

Run fjall destroy with no argument for a guided teardown:
Application loads the applications registered for your organisation and asks which one:
Organisation lists only the tiers scaffolded in the current project:
With no tier scaffolded locally, the screen prints No organisation infrastructure found. / Nothing to destroy. and exits. Selecting Organisation then asks about the cascade, defaulting to No:
The pickers appear only when you run fjall destroy bare. Passing a target (fjall destroy api, fjall org destroy) jumps straight to the confirmation, so on fjall org destroy the cascade is controlled by --no-cascade rather than by the prompt.

Confirmation

The final gate is a typed confirmation, not a yes/no prompt. Type the target name exactly (case-insensitive) to proceed:
--force or --skip-confirmation replaces the typed gate with a skipped step:
In a non-interactive shell, one of those two flags is mandatory. Without either, destroy exits with a validation error:

Arguments

Options

--target selects which account and region the credentials come from. The positional argument stays the application name.

Agent options

For AI-agent and scripted use, destroy also accepts the standard agent flags: Without --force or --skip-confirmation, agent mode returns a structured destructive-confirmation gate naming the exact command to re-run.

Tier destroy options

fjall org destroy, fjall platform destroy and fjall account destroy take -f, --force, --skip-confirmation and --target <target>, plus the standard and agent flags above. --no-cascade is available on fjall org destroy only. --target is refused on fjall org destroy, because organisation infrastructure always deploys to the management account:

Aliases

destroy has one alias, delete:
fjall remove is not a destroy alias. It is the codemod command that removes a single resource from an application’s infrastructure.ts source file. It deletes no deployed AWS resources. See fjall remove.

Examples

Common issues

Stack stuck in DELETE_FAILED

CloudFormation reports the resource blocking the delete. Open the stack’s Events tab in the CloudFormation console, clear the blocker, then run the same fjall destroy command again.

S3 bucket not empty

Fjall empties buckets tagged for auto-delete before deleting the stack. Buckets without that tag are left in place and can block the delete. Empty them, then re-run the destroy.

RDS deletion protection enabled

Deletion protection blocks the stack delete while it is on. Disable it in the RDS console, then re-run the destroy.

Retry, then fall back

  1. Read the CloudFormation events for the failed stack.
  2. Clear the blocker (empty the bucket, disable the protection).
  3. Re-run the same fjall destroy command. Destroy is re-runnable and skips stacks that are already gone.
  4. Delete the remaining stack from the AWS Console as a last resort.

Before you destroy

  1. Snapshot the database. RDS and Aurora take a final snapshot on delete, and production instances retain their automated snapshots. Confirm the snapshot exists in the RDS console before you start.
  2. Copy bucket contents you need. Anything in a bucket tagged for auto-delete goes with the stack.
  3. Export the logs you want to keep. CloudWatch log groups are deleted with their stack.
  4. Check what the application declares. Run fjall list -a api to see every resource in the application’s infrastructure.ts.
  5. Rehearse in a non-production account first.
After the destroy finishes, confirm in the AWS Console that the stacks are gone and that billing for those resources has stopped.
CloudFormation stacks can take 5-10 minutes to delete. A cascading fjall org destroy across several member accounts takes considerably longer.

Next Steps

fjall deploy

Redeploy an application or tier infrastructure.

fjall remove

Remove one resource from infrastructure.ts without touching AWS.

fjall list

Inspect the resources an application declares.

fjall restore

Restore data from a snapshot after teardown.