feat: add AWS Lambda deployment target#116
Merged
Merged
Conversation
Add --lambda to setup-project.sh alongside --cloudflare and --node. Generated projects get a SAM template (API Gateway HTTP API, nodejs22.x on arm64), an esbuild single-file bundle build, a Postgres compose file for local dev, an OIDC-based GitHub Actions deploy workflow, and cold start optimization notes in the README. - templates/aws-lambda/: template.yaml, samconfig.toml, esbuild.config.mjs, docker-compose.yml, deploy.yml - templates/snippets/aws-lambda/: app entry, lambda.handler wrapper (hono/aws-lambda from core hono -- @hono/aws-lambda does not exist), local dev server, config, health route + tests - CI: type-check the new snippets, require templates/aws-lambda - deployment-config-generator and schema-intake skills, pipeline.config.json, and docs updated for the new target Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds AWS Lambda as Nerva's third deployment target, alongside Cloudflare Workers and Node.js/Docker. Generated projects deploy as a single Lambda function behind an API Gateway HTTP API (payload format 2.0) via AWS SAM, with esbuild producing a single-file bundle and GitHub OIDC handling CI/CD credentials.
Closes #32
Changes
setup-project.sh --lambda— new platform branch: copies SAM/esbuild/compose templates, addsbuild:lambda+deploypackage scripts, local dev viasrc/dev.ts(@hono/node-server), writes.env.example, drops the OIDC deploy workflow into.github/workflows/, and generates README sections with cold start optimization notes and the Lambda Web Adapter container alternativetemplates/aws-lambda/—template.yaml(SAM,AWS::Serverless::HttpApi, nodejs22.x on arm64, 512 MB,$defaultcatch-all route),samconfig.toml,esbuild.config.mjs,docker-compose.yml(local Postgres),deploy.yml(GitHub Actions with OIDC —id-token: write,aws-actions/configure-aws-credentials,setup-sam)templates/snippets/aws-lambda/— typechecked app sources including the Lambda entry point:tsconfig.lambda.json);templates/aws-lambdaadded to the required-dirs checkdeployment-config-generatorgains Step 2c (SAM + esbuild + OIDC patterns),schema-intaketarget unions and interview updated,pipeline.config.jsongainsawsLambdablock, target mentions updated across CLAUDE.md/README/onboarding/pipeline docsDeviations from the issue
@hono/aws-lambdadependency — that package does not exist. Hono ships the adapter inside corehonoashono/aws-lambda, so no new runtime dependency is needed (onlyesbuildas a dev dependency in generated projects).sam deployrather thansam build, whose esbuild builder shells out to npm and conflicts with pnpm projects.Test plan
bash -n+ shellcheck (CI severity) onsetup-project.sh; JSON validation of all touched configstsc --noEmitpasses for all three snippet tsconfigs (cloudflare, node, lambda)--lambdaproject: 20/20 Vitest tests pass;pnpm build:lambdaemitsdist/lambda.mjs; invoking the bundledhandlerwith a simulated API Gateway v2$defaultevent returns the app's 200 response--nodeproject (20/20 tests, no leaked lambda scripts) and--cloudflaredry-run unchangeddeploy.yml,docker-compose.yml, and editedci.yml🤖 Generated with Claude Code