moznion / aws-lambda-perl5-layer Goto Github PK
View Code? Open in Web Editor NEWPerl5 layer for AWS Lambda with runtime API
License: MIT License
Perl5 layer for AWS Lambda with runtime API
License: MIT License
Thank you so much for something incredibly useful. Can you please expand on the documentation, please? There are SWS terms that you just throw out there that don't mean anything to us that are still working through the starter Cloud Practitioner stuff.
Thanks!
Hi, I'm just checking out this layer and it seems incredibly helpful! Thanks for providing it.
While reading the code I notice that you don't handle exceptions but rather rely on it calling the default script exception handler. Have you considered using an eval block around the function call to trap exceptions and report them to https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html#runtimes-api-invokeerror . Indeed after that you might want to do the same with the require statement to catch compile errors too.
Anyway, thanks a lot and I expect I'll be using this layer going forward! Cheers.
Is this layer compatible with Amazon Linux OS version 2018.03? https://aws.amazon.com/blogs/compute/upcoming-updates-to-the-aws-lambda-execution-environment/
If not, could you please re-build the layer?
I added the Perl layer with the Using Provided Layers approach but I keep receiving the error:
use: command not found
The Lambda function bootstrap file is successfully finding the pl
file but it doesn't understand that perl code inside of it.
@moznion, are there additional steps to use the provided layer?
For the past couple of hours I've been trying to setup exiftool
on an Lambda instance and have a Node handle invoke it, process the output and send it back. I've managed to set this up easily for ffprobe
since I could just upload it as a static binary (although now I realise that I can use a layer for that).
Since exiftool
is a script I was trying to install perl
somehow and finally, after a lot of digging I found this nice solution.
I'm using the Serverless framework and my .yml
is minimal:
provider:
name: aws
runtime: nodejs10.x
versionFunctions: false
region: eu-central-1
functions:
hello:
handler: handler.hello
layers:
- arn:aws:lambda:eu-central-1:652718333417:layer:perl-5_26-layer:1
The handler function is also minimal, it executes an command that is sent to it:
module.exports.hello = (event, context, callback) => {
if (event.cmd) {
const child = child_process.exec(event.cmd, (error, stdout, stderr) => {
// Resolve with result of process
callback(null, { error, stdout, stderr });
});
}
}
And I'm sending the follwing json:
{
"cmd": "perl -ver"
}
It deploys without problems but when I try to invoke it, I get the following error:
{
"error": {
"killed": false,
"code": 127,
"signal": null,
"cmd": "perl -ver"
},
"stdout": "",
"stderr": "perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory\n"
I'm still new to the whole serverless architecture stuff so there may be a simple solution but I can't seem to find it. Any help would be appreciated.
I'd like to ask how can we add any perl file to lambda folder?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.