Projen

Understand how Projen keeps the starter kit configuration-driven and reproducible.


What is Projen?

Projen is an open-source project scaffolding tool that turns a single TypeScript definition into all of your repository's configuration. Instead of hand-maintaining dozens of JSON/YAML files, you describe the project once in .projenrc.ts and run npx projen to regenerate everything.

Projen was created by former AWS CDK maintainers to bring CDK's infrastructure-as-code philosophy to project configuration. It ensures that formatting, linting, release workflows, and task automation stay consistent with the definition you check into source control.

Why we use it in the starter kit

The AWS CDK Starter Kit relies on Projen for:

  • Environment-aware automation: Each environment you define in .projenrc.ts produces matching npm scripts (npm run test:deploy, npm run production:diff, etc.) and GitHub Actions workflows with the correct AWS account, region, and branch settings.
  • Governed defaults: Projen enforces shared settings—Biome formatting, Dependabot grouping, Node.js versions, and gitignore patterns—so new projects start with our recommended baselines.
  • Self-healing config: When dependencies or settings change upstream (for example, a new CDK version), updating .projenrc.ts and rerunning Projen regenerates the repo to match, reducing drift.

Because everything is generated, you should avoid editing the emitted files directly. Instead, adjust .projenrc.ts, rerun Projen, and review the resulting diff. This workflow keeps the starter kit reproducible and reviewable.

Learn more