Skip to main content
Destroy all resources managed by a stack.

Usage

npx tfts destroy [stack] [options]

Description

The destroy command synthesizes your configuration and runs terraform destroy to remove all infrastructure resources managed by the stack.

Options

OptionTypeDescriptionDefault
--appstringCommand to run the tfts appFrom cdktf.json
--outputstringOutput directorycdktf.out
--skipSynthbooleanSkip synthesis stepfalse
--autoApprovebooleanSkip interactive approvalfalse
--targetstringTarget specific resources (repeatable)-

Examples

Basic Usage

npx tfts destroy
You will be prompted to confirm destruction.

Specific Stack

npx tfts destroy staging

Auto-Approve

Skip the interactive confirmation:
npx tfts destroy --autoApprove

Target Specific Resources

Destroy only specific resources:
npx tfts destroy --target google_compute_instance.web

Safety

By default, destroy requires interactive confirmation. Use --autoApprove only in automated environments where you’re certain about the destruction. To protect critical resources from accidental deletion, use lifecycle rules:
new ComputeInstance(this, "critical", {
  // ...
  lifecycle: {
    preventDestroy: true,
  },
});