This is the Bun 💨 for your AWS CDK development ☁️ with Bun and TypeScript. Read on how built this project.
- Native Bun tools: such as runtime,
vitest, andbun test
bun
dler - AWS CDK
- A Construct for your Bun Lambda
BunFun
- A Lambda Layer Stack for your Bun Runtime thanks to
bun-lambda
- A Construct for your Bun Lambda
- Lint and Formatting for Typescript with @antfu/eslint-config (If you don't like it, remove the
@antfu/eslint-config
)
NOTE: Please, no global CDK -->
npm remove -g cdk
. Check out why!
- Bun is a swiss army knife for all your Typescript projects.
- Bun has its own Bundler which doesn't care if you use ESM or CJS
- Bun has its own Testing library
- Bun has its own Runtime to execute Typescript, and Javascript files without transpiling them
The difference here is:
- Remove Jest and use
vitestbun test
- Replace
npx
withbun
- commands - Bun as Package Manager
- Added Eslint
- Use Monorepo
bun build
emits the synthesized CloudFormation template orbun cdk synth
bun watch
watch for changes and compilebun run test
perform the vitest unit tests (NOTE:bun test
would run thebun test
instead of vitest)bun cdk deploy:all
deploy this stack to your default AWS account/region- Use
AWS_PROFILE=my-profile bun cdk deploy:all
when deploying using an profile - Use
bun cdk:only
when deploying a single Stack (default isBunFunStack
) - Use
STACK=MyCustomStack bun cdk:only
when deploying a singleMyCustomStack
Stack
- Use
bun cdk diff
compare deployed stack with current statebun cdk synth
emits the synthesized CloudFormation template
- Sometimes the first time you hit any
bun deploy
, you may encounter an error. Just run it again. Maybe bun is too quick for AWS CLI, I have no idea why that happen 🤷♂️