NAME
AWS::Lambda::Bootstrap - the bootrap script for AWS Lambda Custom Runtime.
SYNOPSIS
Save the following script as bootstrap
, and then zip it with your perl script. Now, you can start using Perl in AWS Lambda!
#!perl
use strict;
use warnings;
use utf8;
use AWS::Lambda::Bootstrap;
bootstrap(@ARGV);
Prebuild Perl Runtime Layer includes the bootstrap
script. So, if you use the Layer, no need to include the bootstrap
script into your zip. See AWS::Lambda for more details.
DESCRIPTION
The format of the handler is following.
sub handle {
my ($payload, $context) = @_;
# handle the event here.
my $result = {};
return $result;
}
$context
is an instance of AWS::Lambda::Context.
RESPONSE STREAMING
It also supports response streaming.
sub handle {
my ($payload, $context) = @_;
return sub {
my $responder = shift;
my $writer = $responder->('application/json');
$writer->write('{"foo": "bar"}');
$writer->close;
};
}
LICENSE
The MIT License (MIT)
Copyright (C) ICHINOSE Shogo.
AUTHOR
ICHINOSE Shogo <shogo82148@gmail.com>