Set of examples to demonstrate the various ways applications can be deployed on AWS using AWS CDK.
- Node.js 20.x
- direnv
- curl
- httpie (optional - only needed for the domain configuration script
./scripts/delegate-subdomain.sh) - AWS CLI with account setup. (https://www.granted.dev is a great tool for switching profiles.)
aws-cdkandyalc:npm i -g aws-cdk yalc.Yalcis a tool to work easily with npm packages locally.
- Clone the repository. It's a monorepo with application projects in the
packagesfolder. - Install dependencies.
- Root folder:
npm i - Install dependencies of all the projects:
npm i -ws
- Root folder:
- The
common-constructsproject is an aws cdk library project with custom resources and common constructs.- Build the project:
npm run build -w common-constructs - Publish it to
yalc:npm run yalc:publish -w common-constructs
- Build the project:
- Create
.env. Theenv-examplefile can be used as a template for it. - Domain setup
- I use Cloudflare as my DNS provider and wanted to delegate only a sub-domain to Route53. The script
./scripts/delegate-subdomain.shdoes that. - Update the
.envfile with necessary information.
- I use Cloudflare as my DNS provider and wanted to delegate only a sub-domain to Route53. The script
- OIDC authentication:
- Create Google credentials for OIDC authentication.
- Once created, run the script
./scripts/create-google-secret.shto create a AWS Secrets Manager secret for Google client secret. - Update
.envfile with Google Client Id and ARN of the secret.