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-cdk
andyalc
:npm i -g aws-cdk yalc
.Yalc
is a tool to work easily with npm packages locally.
- Clone the repository. It's a monorepo with application projects in the
packages
folder. - Install dependencies.
- Root folder:
npm i
- Install dependencies of all the projects:
npm i -ws
- Root folder:
- The
common-constructs
project 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-example
file 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.sh
does that. - Update the
.env
file 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.sh
to create a AWS Secrets Manager secret for Google client secret. - Update
.env
file with Google Client Id and ARN of the secret.