WindowsmacOSLinux

Where Does CDKTF Store Config and Output?

CDKTF projects declare stacks in cdktf.json and synthesize Terraform JSON into cdktf.out, with local state beside it.

Last updated

CDKTF splits its footprint between declaration and synthesis. The cdktf.json file lists the language, providers, and stack entry points. Running synth compiles those stacks into Terraform JSON inside cdktf.out, one folder per stack, ready for plan and apply.

Local Terraform state lands beside the synthesized output when no remote backend is configured. Stack outputs and variables resolve from these folders during apply, which is why plan and apply must run against the same freshly synthesized tree. That makes cdktf.out doubly disposable and doubly sensitive: delete it freely, but never publish it, since state files can carry secrets.

Where CDKTF stores this, by platform

Windows
[ProjectDir]\cdktf.json

Stack entry points, providers, and output settings. The cdktf.out folder beside it holds synthesized JSON plus local state. Regenerate with cdktf synth after wiping.

macOS
[ProjectDir]/cdktf.json

Same project-relative layout on macOS. Remote backends move state out of cdktf.out, but the synthesized JSON stays local and regenerable either way.

Linux
[ProjectDir]/cdktf.json

Same arrangement. Keep state files out of git regardless of backend; cdktf.json and stack code are the committable half.

Frequently asked questions

Synthesized output looks stale. What do I remove?

Delete cdktf.out and run cdktf synth again. It is pure synthesized output plus per-stack Terraform state for local backends. The cdktf.json and stack code regenerate it completely.

Should cdktf.out be committed?

Yes. Commit cdktf.json and the stack source. The cdktf.out folder is generated output, and the template gitignores it alongside node_modules and plan files.

Notice an outdated path? Let us know.