DEV Community

loading...

Discussion on: Building an AWS Lambda extension with Rust

Collapse
klaatu01 profile image
Charlie Ede

Hey Duarte great post!
I have implemented something similar myself, but I can manage to get my extension to start running. It would be great to see the source code, To check I have my file structures right.

Collapse
duarten profile image
Duarte Nunes Author • Edited

Thanks! :)

Here's a gist with the extension code: gist.github.com/duarten/855f8e18e3...

When you package the Lambda layer, the extension executable must be named the same as what it passed to the Register API, and it must be in the "extensions" folder. For example:

❯ unzip -l target/lambda/release/sidecar.zip
Archive:  target/lambda/release/sidecar.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
  7778472  11-04-2020 17:18   extensions/sidecar
---------                     -------
  7778472                     1 file
Enter fullscreen mode Exit fullscreen mode

I can provide the CDK code as a gist too, but it's pretty much the same as what's in the post :)