elysia-lambda icon indicating copy to clipboard operation
elysia-lambda copied to clipboard

Proposed fix for [BUG] Deployment expects layer in the wrong region #2

Open rainstormai7 opened this issue 1 year ago • 0 comments

Proposed Fix For Issue: [BUG] Deployment expects layer in the wrong region #2

  1. Added the option region options.region
  2. Upgrade All Package Dependencies to latest version

Then Tested with the following:-

  1. Create a new Elysia project bun create elysia app
  2. Installed the local version of this update repo package bun add ../../elysia-lambda/
  3. Updated the resulting app/src/index.ts
import { Elysia } from 'elysia'
import { lambda } from 'elysia-lambda'

const app = new Elysia()
    .use(lambda())
    .get("/", () => "Hello Elysia").listen(3000);

console.log(
  `🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`
);
  1. Initialised the AWS Lambda YAML config bunx elysia-lambda --init
  2. See the resulting YAML
deploy: src/index.ts
name: elysia-lambda
region: eu-west-2
memory: "256"
arch: arm64
description: Elysia Lambda
role: arn:aws:iam::[AWS_ACCOUNT_ID]:role/LambdaAWSRole
layers:
  - arn:aws:lambda:eu-west-2:[AWS_ACCOUNT_ID]:layer:bun:5
  1. Deployed the Lambda into an AWS Region Different to the Default of us-east-1 - run bun deploy
  2. Create an AWS Lambda Function URL to test
  3. Go the URL in the browser to test the new endpoint:- image

rainstormai7 avatar Feb 14 '24 07:02 rainstormai7