A TypeScript AWS Lambda bot that runs on a schedule to perform some simple task.
It's like having an easy way to create cron jobs on AWS that cost almost nothing to maintain!
If this has helped you please consider giving it a star!
- Node.js v18 or later
- AWS CLI configured with appropriate credentials
- AWS CDK CLI installed globally (
npm install -g aws-cdk
)
- Install dependencies:
npm install
- Build the project:
npm run build
- Set up your own local config file:
# Copy the example config file
cp src/lambda/config.example.ts src/lambda/config.ts
# Edit the config file with your settings
- Modify the Lambda configuration and trigger frequency: lambda-stack.ts
Run the bot locally:
npm run local
Run the test suite (will fail with no tests):
npm test
The project uses ESLint with TypeScript support for code quality.
- Run linting check:
npm run lint
- Fix auto-fixable issues:
npm run lint:fix
- Build the project:
npm run build
- Watch for changes:
npm run watch
- Synthesize CloudFormation template:
npm run synth
- Compare deployed stack with current state:
npm run diff
- Make sure you have AWS credentials configured:
aws configure
- Deploy the stack:
npm run deploy
.
├── src/
│ └── lambda/ # Lambda function code
├── lib/ # CDK infrastructure code
├── bin/ # CDK app entry point
├── dist/ # Compiled JavaScript
└── cdk.out/ # CDK output