Skip to content

CDKTF app that deploys SvelteKit and Hono Lambdaliths along with an Upstash Redis database to AWS

License

Notifications You must be signed in to change notification settings

garysassano/cdktf-aws-sveltekit-hono-lambdaliths

Repository files navigation

cdktf-aws-sveltekit-hono-lambdaliths

CDKTF app that deploys SvelteKit and Hono Lambdaliths along with an Upstash Redis database to AWS.

This app leverages the AWS Lambda Web Adapter with Lambda Function URLs.

Application Details

  • back-lambda
    • Environment variables:
      • REDIS_URL - Address of the Redis database in the form of rediss://<user>:<psw>@<host>:<port>
    • Port bindings:
      • 3000
    • Endpoints:
      • / - Hello message display
      • /ping - Returns static "pong" response (used for readyness check)
      • /api/clicks - Returns current click count
      • /api/clicks/incr - Increments click count by 1 and returns new click count
  • front-lambda
    • Environment variables:
      • BACKEND_URL - Address of the backend service reachable from the server side in the form of https://<host>
    • Port bindings:
      • 3000
    • Endpoints:
      • / - Click counter display
      • /ping - Returns static "pong" response (used for readyness check)

Prerequisites

  • AWS:
  • Upstash:
    • Must have set the UPSTASH_EMAIL and UPSTASH_API_KEY variables in your local environment.
  • Node.js + npm:
  • Docker:
    • Must be installed in your system and running at deployment.

Installation

npx projen install

Deployment

npx projen deploy

Cleanup

npx projen destroy

Architecture Diagram

Architecture Diagram