
Self-executable CDK apps.

Usage
Create an executable TypeScript file for your CDK app ./bin/my-app.ts using the updown() function.
import { updown } from "@mrgrain/cdk-updown";
import { App, Stack, aws_sns } from "aws-cdk-lib";
const cli = updown(async () => {
const app = new App();
const stack = new Stack(app);
new aws_sns.Topic(stack, "Topic");
return app.synth();
});
await cli.run();
Then execute as usual:
npx tsx ./bin/my-app.ts
Single-file executable
Using a bundle that can produce single-file executables, it is easily possible to make your CDK app fully runtime independent.
For example with Bun:
bun build ./bin/my-app.ts --compile --minify --outfile ./dist/my-app
Now you have a fully self-contained binary of your app:
./dist/my-app