t3wad
12/01/2022, 3:55 PMAndrew O'Hara
12/01/2022, 5:53 PMdave
12/01/2022, 9:00 PMmemory x time
, so if you've got heavyweight ZIP files or frameworks then that will still cost. (http4k of course is super lightweight so we hope snapstart will continue to give us an edge in this 😉 )dave
12/01/2022, 9:02 PMandyg
12/03/2022, 8:54 AMdave
12/03/2022, 8:59 AMdave
12/03/2022, 9:01 AMdave
12/03/2022, 9:10 AMapp.asServer(AwsLambdaRuntime())
) and stick it inside a main. So this means it's trivial to test your entire app locally as well, as outside the runtime requests are just http - so you can just run them in the normal way.
The http4k AWS adapter layer handles the transition between the AWS JSON format and standard http.
https://github.com/http4k/http4k/blob/master/http4k-serverless/lambda-runtime/src/main/kotlin/org/http4k/serverless/AwsLambdaRuntime.ktdave
12/03/2022, 9:18 AMandyg
12/04/2022, 2:23 AMdave
12/05/2022, 4:48 PMYour custom runtime runs in the standard Lambda execution environment. It can be a shell script, a script in a language that's included in Amazon Linux, or a binary executable file that's compiled in Amazon Linux.
https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.htmldave
12/05/2022, 4:49 PMconst lambdaFunction = new aws.lambda.Function("hello-http4k", {
code: new pulumi.asset.FileArchive("HelloHttp4k.zip"),
handler: "unused",
role: defaultRole.arn,
runtime: "provided.al2"
});
dave
12/05/2022, 4:51 PM