Skip to main content
Apply changes to your infrastructure.

Usage

npx tfts deploy [stack] [options]

Aliases

  • apply

Description

The deploy command synthesizes your configuration and runs terraform apply to create, update, or delete infrastructure resources.

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 deploy
You will be prompted to approve the changes.

Specific Stack

npx tfts deploy production

Auto-Approve (CI/CD)

Skip the interactive approval prompt:
npx tfts deploy --autoApprove

Skip Synthesis

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

Target Specific Resources

Deploy only specific resources:
npx tfts deploy --target google_compute_instance.web

CI/CD Usage

For automated deployments:
npx tfts deploy --autoApprove
Or with environment-specific stacks:
npx tfts deploy production --autoApprove

Automatic Initialization

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