elysia-lambda
elysia-lambda copied to clipboard
Proposed fix for [BUG] Deployment expects layer in the wrong region #2
Proposed Fix For Issue: [BUG] Deployment expects layer in the wrong region #2
- Added the option region
options.region - Upgrade All Package Dependencies to latest version
Then Tested with the following:-
- Create a new Elysia project
bun create elysia app - Installed the local version of this update repo package
bun add ../../elysia-lambda/ - 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}`
);
- Initialised the AWS Lambda YAML config
bunx elysia-lambda --init - 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
- Deployed the Lambda into an AWS Region Different to the Default of
us-east-1-run bun deploy - Create an AWS Lambda Function URL to test
- Go the URL in the browser to test the new endpoint:-