From e8dd39f2e855829a618c3aaf2bac2e464fc3a994 Mon Sep 17 00:00:00 2001 From: Shyim Date: Thu, 19 Sep 2024 13:50:56 +0200 Subject: [PATCH 1/2] feat: add provided.al2 to runtime enum --- platform/src/components/aws/function.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/platform/src/components/aws/function.ts b/platform/src/components/aws/function.ts index 0b158f437..c8841ae35 100644 --- a/platform/src/components/aws/function.ts +++ b/platform/src/components/aws/function.ts @@ -261,13 +261,14 @@ export interface FunctionArgs { * ``` */ runtime?: Input< - | "nodejs18.x" - | "nodejs20.x" - | "provided.al2023" - | "python3.9" - | "python3.10" - | "python3.11" - | "python3.12" + | "nodejs18.x" + | "nodejs20.x" + | "provided.al2023" + | "provided.al2" + | "python3.9" + | "python3.10" + | "python3.11" + | "python3.12" >; /** * Path to the source code directory for the function. By default, the handler is From 89245ac626e270dcd0e4f657d2b584e4e8667b68 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Fri, 11 Oct 2024 14:47:22 +0200 Subject: [PATCH 2/2] feat: add skipHandlerWrapper --- platform/src/components/aws/function.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/src/components/aws/function.ts b/platform/src/components/aws/function.ts index c8841ae35..dc670bc3c 100644 --- a/platform/src/components/aws/function.ts +++ b/platform/src/components/aws/function.ts @@ -1056,6 +1056,11 @@ export interface FunctionArgs { * @internal */ _skipMetadata?: boolean; + + /** + * If enabled, it does not create an lambda wrapper which makes it possible to use with different custom runtimes like PHP + */ + skipHandlerWrapper?: Input } /** @@ -1530,7 +1535,7 @@ export class Function extends Component implements Link.Linkable { runtime, ]) => { if (dev) return { handler }; - if (runtime.startsWith("python")) { + if (runtime.startsWith("python") || args.skipHandlerWrapper) { return { handler }; }