This is a highly opinionated CDKTF template for Typescript that I developed to ease my IaaC management and have been using this is production environment for some time now without any hitch.
If you want to see a real-life example of how this template works, visit this repo.
- Use any supported backend (default is
local
). - Automatically autoload all stacks and its constructs (resources and data).
- A minimal dependency injector using tsyringe.
- Define Terraform Cloud workspace using the
@Workspace(workspace: string, project?: string)
decorator. - View all your definitions in a tree format by running
npx ts-node main.ts
. - GitHub workflows to automatically plan and apply changes (put
.env
file contents insideENV_FILE_CONTENTS
environment secret).
- Terraform:
>=1.5
- CDKTF:
>=0.17
- NodeJS:
>=20.0
- Yarn:
>=1.22
- Create a template from this repo.
- Update the value for
projectId
inside thecdktf.json
file. You can generate a random UUID from here. - Install dependencies by running
yarn install --frozen-lockfile
. - Install your required providers by running
cdktf provider add <provider...>
. - Create your stacks.
- Run
cdktf apply '*'
. - ???
- Profit.
You can follow these instructions to set up unit tests.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.