This project contains two CDK stacks:
- Nodejs Lambda, to create an ESBuild compiled Node.js Typescript lambda function. Default is to hit the US Treasury API for a thrilling reminder about the US National Debt.
- Event CRON, which by default generates an AWS event for each Weekday, which triggers an input Lambda function to execute.
This repo assumes you have already followed the CDK scaffold for your already setup AWS Account CLI.
To deploy as-is, from the root of the repository:
# Check that cdk is installed correctly
which cdk
# install dependencies - alternatively `npm install`
yarn install
# head over to where the stacks are declared
cd bin
# deploy Event CRON stack, which depends upon the Lambda
cdk deploy USDebtCRONTrigger
The cdk.json
file tells the CDK Toolkit how to execute your app.
yarn build
compile typescript to jsyarn watch
watch for changes and compileyarn test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template