Skip to main content
Preview the changes that will be made to your infrastructure.

Usage

npx tfts diff [stack] [options]

Aliases

  • plan

Description

The diff command synthesizes your configuration and runs terraform plan to show what changes would be made to your infrastructure. If no stack is specified, it operates on all stacks.

Options

OptionTypeDescriptionDefault
--appstringCommand to run the tfts appFrom cdktf.json
--outputstringOutput directorycdktf.out
--skipSynthbooleanSkip synthesis stepfalse
--refreshOnlybooleanOnly refresh state, no changesfalse
--targetstringTarget specific resources (repeatable)-

Examples

Basic Usage

npx tfts diff

Specific Stack

npx tfts diff production

Skip Synthesis

Use when you’ve already run tfts synth:
npx tfts diff --skipSynth

Refresh Only

Only update state without planning changes:
npx tfts diff --refreshOnly

Target Specific Resources

npx tfts diff --target google_compute_instance.web
npx tfts diff --target google_compute_instance.web --target google_compute_disk.data

Output

The command shows Terraform’s plan output, including:
  • Resources to be created (+)
  • Resources to be updated (~)
  • Resources to be destroyed (-)
  • Resource attributes that will change

Automatic Initialization

If the stack hasn’t been initialized, tfts diff automatically runs terraform init before planning.