Skip to content

Conversation

@rainstormai7
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant