This repository contains the CDKTF projects for provisioning the infrastructure for Magiscribe project, including but not limited to the API and client applications.
- Node.js (version 20.x or later)
- AWS CLI
- Terraform CDKTF
- Docker
The following steps are required to setup the project for deployment to AWS.
! IMPORTANT ! As of writing, the both the bootstrap and infrastructure stacks are on Node 20.x. This is because the CDKTF project has not been updated to support Node 22.x. This will be updated in the future. See here for the build targets supported by the CDKTF project.
The bootstrap setup is a one-time setup that will create the necessary resources in AWS to manage the remote state of the Terraform projects. For more information on this, see Terraform Remote State.
- Check into
/bootstrap
directory
cd bootstrap
- Specify the environment you want to deploy to. This can be done by setting the
NODE_ENV
environment variable. The default value isdevelopment
.
export NODE_ENV=production
- Deploy the bootstrap stack
cdktf deploy
- Check into
/infrastructure
directory
cd infrastructure
- Specify the environment you want to deploy to. This can be done by setting the
NODE_ENV
environment variable. The default value isdevelopment
.
export NODE_ENV=production
- Deploy the networking stack. Note, the first time you run this, it will create a new Hosted Zone in Route 53. You will need to point your domain registrar to the name servers provided by Route 53 so that it can manage the DNS records and auto-verify the SSL certificates created by this project.
cdktf deploy network
- Deploy the database stack
cdktf deploy network data
- Deploy the app stack
cdktf deploy network data app
- Deploy the client stacks
cdktf deploy network data app client-app client-dashboard