From 6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Thu, 2 Jul 2026 11:55:17 -0700 Subject: Init --- Homework/cs5260/README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Homework/cs5260/README.md (limited to 'Homework/cs5260/README.md') diff --git a/Homework/cs5260/README.md b/Homework/cs5260/README.md new file mode 100644 index 0000000..1196082 --- /dev/null +++ b/Homework/cs5260/README.md @@ -0,0 +1,50 @@ +# cs5260 consumer + +This project uses the [Bun TS Runtime](https://bun.sh/) + +To install dependencies: + +```bash +bun install +``` + +To run: + +```bash +bun run index.ts +``` + +With the arguments: +``` +--sourcebucket: the bucket to poll for widget requests +--storagebucket: the bucket to store and modify widgets according to received requests +--storagetable: the DDB table to store and modify widgets according to received requests +--storageprefix: the prefix to store S3 objects in (only required if storagebucket is given) +``` + +And either one of storagebucket or storagetable must be given. + +Unit tests: +```bash +bun test +``` + +## Lambda Handler +There is a current bug in bun 1.0.8, the latest version: [https://github.com/oven-sh/bun/issues/7028], +which is not present in v1.0.7 and earlier. Thus, I recommend using `asdf` to manage the bun version in +this part of the project. + +To deploy the lambda handler, first build and publish the Bun runtime layer on your +AWS account: +```bash +bun run build-layer --arch aarch64 \ + --release 1.0.7 --output ./bun-lambda-layer.zip +bun run publish-layer --region us-east-1 \ + --arch aarch64 --release 1.0.7 \ + --output ./bun-lambda-layer.zip +``` + +Then, create a Lambda function with runtime "custom bootstrap on amazon linux 2" and +name "widget-api-handler", and handler to "handler.fetch" (found in "Code"). + +In the Lambda console then attach the layer "bun". -- cgit v1.3