AWS-Lambda

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl extension aws-lambda

0.9.0 2026-04-04T02:09:23Z
    - Perl 5.42.2 and 5.40.4 are released #220
    - bump JSON 4.11 #218
    - bump Net::SSLeay 1.96 #216

0.8.0 2026-03-21T09:47:41Z
    - Perl 5.42.1 is released #215

0.7.0 2025-12-13T04:33:18Z
    - Support tenant id in AWS::Lambda::Context #203
    - Add support for AWS_LAMBDA_MAX_CONCURRENCY #204
    - Mark Amazon Linux 2 (AL2) based layers as no longer maintained #206

0.6.0 2025-09-10T02:50:47Z
    - Perl 5.42.0 is released #194

0.5.5 2025-09-10T01:19:36Z
    - ap-southeast-6 is available #199
    - bump JSON::XS 4.04 and Cpanel::JSON::XS 4.04 #197
    - bump IO::Socket::SSL 2.095 #184, #187, #193

0.5.4 2025-06-16T02:52:21Z
    - ap-east-2 is available #182
    - bump IO::Socket::SSL 2.091 #177, #181
    - bump Mozilla::CA 20250602 #177

0.5.3 2025-06-04T10:53:08Z
    - Perl 5.40.2 and 5.38.4 are released #170

0.5.2 2025-01-20T20:32:05Z
    - Perl 5.40.1 and 5.38.3 are released #164
    - ap-northeast-7 adn mx-central-1 are available #166
    - bump IO::Socket::SSL 2.089 #155
    - bump YAML::XS 0.902.0 #156, #158
    - bump Mozii::CA 20240924 #159
    - bump Cpanel::JSON::XS v4.39 #160
    - bump YAML::Tiny v1.76 #161, #162

0.5.1 2024-08-26T11:04:34Z
    - ap-southeast-5 is available
    - AWS Lambda Functions powered by AWS Graviton2 now available on ca-west-1
    - bump JSON::MaybeXS 1.004008 #152, #153
    - bump Mozilla::CA 20240730 #150
    - bump IO::Socket::SSL 2.088 #147, 148, #149

0.5.0 2024-06-11T05:13:06Z
    - Perl 5.40.0 is released
    - bump IO::Socket::SSL 2.085 #140
    - bump YAML::XS 0.89 #142

0.4.3 2024-01-22T01:05:31Z
    - bump Paws v0.46 #138

META.json  view on Meta::CPAN

            "Test::Spellunker" : "v0.2.7",
            "Version::Next" : "0"
         }
      },
      "runtime" : {
         "recommends" : {
            "AWS::XRay" : "0.09"
         },
         "requires" : {
            "HTTP::Tiny" : "0.076",
            "JSON::Types" : "0.05",
            "JSON::XS" : "4.0",
            "MIME::Base64" : "0",
            "Parallel::Prefork" : "0",
            "Plack" : "1.0047",
            "Plack::Middleware::ReverseProxy" : "0.16",
            "Try::Tiny" : "0.30",
            "URI::Escape" : "0",
            "perl" : "5.026000"
         }
      },
      "test" : {

META.json  view on Meta::CPAN

      }
   },
   "version" : "0.9.0",
   "x_contributors" : [
      "ICHINOSE Shogo <shogo82148@gmail.com>",
      "Jose Luis Martinez <jlmartinez@capside.com>",
      "Mohammad S Anwar <mohammad.anwar@yahoo.com>",
      "dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>",
      "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
   ],
   "x_serialization_backend" : "JSON::PP version 4.16",
   "x_static_install" : 1
}

META.yml  view on Meta::CPAN

  AWS::Lambda::Context:
    file: lib/AWS/Lambda/Context.pm
  AWS::Lambda::PSGI:
    file: lib/AWS/Lambda/PSGI.pm
  AWS::Lambda::ResponseWriter:
    file: lib/AWS/Lambda/ResponseWriter.pm
recommends:
  AWS::XRay: '0.09'
requires:
  HTTP::Tiny: '0.076'
  JSON::Types: '0.05'
  JSON::XS: '4.0'
  MIME::Base64: '0'
  Parallel::Prefork: '0'
  Plack: '1.0047'
  Plack::Middleware::ReverseProxy: '0.16'
  Try::Tiny: '0.30'
  URI::Escape: '0'
  perl: '5.026000'
resources:
  bugtracker: https://github.com/shogo82148/p5-aws-lambda/issues
  homepage: https://github.com/shogo82148/p5-aws-lambda

README.md  view on Meta::CPAN

    # run an event.
    docker run --rm -v $(PWD):/var/task shogo82148/p5-aws-lambda:5.38.al2023 \
        handler.handle '{"some":"event"}'

## Pre-installed modules

The following modules are pre-installed for convenience.

- [AWS::Lambda](https://metacpan.org/pod/AWS%3A%3ALambda)
- [AWS::XRay](https://metacpan.org/pod/AWS%3A%3AXRay)
- [JSON](https://metacpan.org/pod/JSON)
- [Cpanel::JSON::XS](https://metacpan.org/pod/Cpanel%3A%3AJSON%3A%3AXS)
- [JSON::MaybeXS](https://metacpan.org/pod/JSON%3A%3AMaybeXS)
- [YAML](https://metacpan.org/pod/YAML)
- [YAML::Tiny](https://metacpan.org/pod/YAML%3A%3ATiny)
- [YAML::XS](https://metacpan.org/pod/YAML%3A%3AXS)
- [Net::SSLeay](https://metacpan.org/pod/Net%3A%3ASSLeay)
- [IO::Socket::SSL](https://metacpan.org/pod/IO%3A%3ASocket%3A%3ASSL)
- [Mozilla::CA](https://metacpan.org/pod/Mozilla%3A%3ACA)
- [local::lib](https://metacpan.org/pod/local%3A%3Alib)

[Paws](https://metacpan.org/pod/Paws) is optional. See the "Paws SUPPORT" section.

author/build-perl-al2023.sh  view on Meta::CPAN

# helper script for build-perl-runtime-al2023.sh
# you should not run this script directly.

set -uex

PERL_VERSION=$1

NET_SSLEAY_VERSION=1.96
CARTON_VERSION=v1.0.35
AWS_XRAY_VERSION=0.12
JSON_VERSION=4.11
JSON_XS_VERSION=4.04
CPANEL_JSON_XS_VERSION=4.40
JSON_MAYBEXS_VERSION=1.004008
YAML_VERSION=1.31
YAML_TINY_VERSION=1.76
YAML_XS_VERSION=v0.904.0
IO_SOCKET_SSL_VERSION=2.098
MOZILLA_CA_VERSION=20250602
LOCAL_LIB_VERSION=2.000029


# build-provided.al2023 lacks some development packages
dnf install -y perl glibc-langpack-en openssl openssl-devel

author/build-perl-al2023.sh  view on Meta::CPAN

install /tmp/cpanm /opt/bin/cpanm
curl -fsSL --compressed https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl -i -pe 's(^#!.*perl$)(#!/opt/bin/perl)' > /tmp/cpm
install /tmp/cpm /opt/bin/cpm

# Net::SSLeay needs special CCFLAGS and LIBS to link
PERL_MM_OPT="INSTALLDIRS=vendor INSTALLMAN1DIR=none INSTALLMAN3DIR=none" /opt/bin/cpanm --notest "Net::SSLeay@$NET_SSLEAY_VERSION"

/opt/bin/cpanm --notest \
    "Carton@$CARTON_VERSION" \
    "AWS::XRay@$AWS_XRAY_VERSION" \
    "JSON@$JSON_VERSION" \
    "Cpanel::JSON::XS@$CPANEL_JSON_XS_VERSION" \
    "JSON::XS@$JSON_XS_VERSION" \
    "JSON::MaybeXS@$JSON_MAYBEXS_VERSION" \
    "YAML@$YAML_VERSION" \
    "YAML::Tiny@$YAML_TINY_VERSION" \
    "YAML::XS@$YAML_XS_VERSION" \
    "IO::Socket::SSL@$IO_SOCKET_SSL_VERSION" \
    "Mozilla::CA@$MOZILLA_CA_VERSION" \
    "local::lib@$LOCAL_LIB_VERSION"
/opt/bin/cpanm --notest .

# replace shebang to the absolute path of perl
cp script/bootstrap /opt/

author/build-perl-runtime-al2023.sh  view on Meta::CPAN

    --rm --platform "$DOCKER_PLATFORM" \
    "public.ecr.aws/sam/build-provided.al2023:1-$PLATFORM" \
    ./author/build-perl-al2023.sh "$PERL_VERSION"

# sanity check the perl binary works on the emulation images
docker run \
    -v "$OPT-$PLATFORM:/opt" \
    --rm --platform "$DOCKER_PLATFORM" \
    --entrypoint /opt/bin/perl \
    "public.ecr.aws/lambda/provided:al2023-$PLATFORM" \
    -MJSON::XS -MYAML::XS -MNet::SSLeay -MIO::Socket::SSL -MMozilla::CA \
    -MAWS::XRay -MAWS::Lambda -MAWS::Lambda::PSGI -e ''

# create zip archive
cd "$OPT-$PLATFORM"
mkdir -p "$DIST"
zip -9 -r "$DIST/perl-$TAG-runtime-al2023-$PLATFORM.zip" .

author/publish-perl-runtime-archives.pl  view on Meta::CPAN

#!/usr/bin/env perl

use 5.03800;
use strict;
use warnings;
use FindBin;
use Parallel::ForkManager;
use File::Basename 'basename';
use JSON qw(decode_json encode_json);

my $force = ($ARGV[0] // '') eq '-f';

sub head_or_put {
    my ($key, $zip) = @_;
    my $object = decode_json(`aws --output json --region us-east-1 s3api head-object --bucket shogo82148-lambda-perl-runtime-us-east-1 --key "$key" || echo "{}"`);
    my $current = $object->{Metadata}{md5chksum} || "";
    if (!$current) {
        say STDERR "Upload $zip to 3://shogo82148-lambda-perl-runtime-us-east-1/$key";
        my $cmd = "aws --output json --region 'us-east-1' s3api put-object --bucket 'shogo82148-lambda-perl-runtime-us-east-1' --key '$key' --body '$zip'";

author/publish-perl-runtimes.pl  view on Meta::CPAN

#!/usr/bin/env perl

use 5.03000;
use strict;
use warnings;
use FindBin;
use Parallel::ForkManager;
use File::Basename 'basename';
use JSON qw(decode_json);

my $force = ($ARGV[0] // '') eq '-f';

sub head_or_put {
    my ($region, $key, $zip, $md5) = @_;
    my $object = decode_json(`aws --output json --region "$region" s3api head-object --bucket "shogo82148-lambda-perl-runtime-$region" --key "$key" || echo "{}"`);
    my $current = $object->{Metadata}{md5chksum} || "";
    if ($current ne $md5) {
        say STDERR "Upload $zip to 3://shogo82148-lambda-perl-runtime-$region/$key";
        my $cmd = "aws --output json --region '$region' s3api put-object --bucket 'shogo82148-lambda-perl-runtime-$region' --key '$key' --body '$zip' --content-md5 '$md5' --metadata md5chksum='$md5'";

author/update-aws-lambda-al.pl  view on Meta::CPAN

=head2 Pre-installed modules

The following modules are pre-installed for convenience.

=over

=item L<AWS::Lambda>

=item L<AWS::XRay>

=item L<JSON>

=item L<Cpanel::JSON::XS>

=item L<JSON::MaybeXS>

=item L<YAML>

=item L<YAML::Tiny>

=item L<YAML::XS>

=item L<Net::SSLeay>

=item L<IO::Socket::SSL>

author/update-aws-lambda-al2.pl  view on Meta::CPAN

=head2 Pre-installed modules

The following modules are pre-installed for convenience.

=over

=item L<AWS::Lambda>

=item L<AWS::XRay>

=item L<JSON>

=item L<Cpanel::JSON::XS>

=item L<JSON::MaybeXS>

=item L<YAML>

=item L<YAML::Tiny>

=item L<YAML::XS>

=item L<Net::SSLeay>

=item L<IO::Socket::SSL>

author/update-aws-lambda-al2023.pl  view on Meta::CPAN

=head2 Pre-installed modules

The following modules are pre-installed for convenience.

=over

=item L<AWS::Lambda>

=item L<AWS::XRay>

=item L<JSON>

=item L<Cpanel::JSON::XS>

=item L<JSON::MaybeXS>

=item L<YAML>

=item L<YAML::Tiny>

=item L<YAML::XS>

=item L<Net::SSLeay>

=item L<IO::Socket::SSL>

author/update-dependencies.sh  view on Meta::CPAN

    echo "update $MODULE $VERSION_NAME $FILE_NAME $VERSION"

    export VERSION_NAME
    export VERSION
    perl -i -pe 's/^\Q$ENV{VERSION_NAME}\E=.+$/$ENV{VERSION_NAME}=$ENV{VERSION}/' "$FILE_NAME"
}

update Net-SSLeay NET_SSLEAY_VERSION build-perl-al2.sh
update Carton CARTON_VERSION build-perl-al2.sh
update AWS-XRay AWS_XRAY_VERSION build-perl-al2.sh
update JSON JSON_VERSION build-perl-al2.sh
update JSON-XS JSON_XS_VERSION build-perl-al2.sh
update Cpanel-JSON-XS CPANEL_JSON_XS_VERSION build-perl-al2.sh
update JSON-MaybeXS JSON_MAYBEXS_VERSION build-perl-al2.sh
update YAML YAML_VERSION build-perl-al2.sh
update YAML-Tiny YAML_TINY_VERSION build-perl-al2.sh
update YAML-LibYAML YAML_XS_VERSION build-perl-al2.sh
update IO-Socket-SSL IO_SOCKET_SSL_VERSION build-perl-al2.sh
update Mozilla-CA MOZILLA_CA_VERSION build-perl-al2.sh
update local-lib LOCAL_LIB_VERSION build-perl-al2.sh

update Paws PAWS_VERSION build-paws-al2.sh


update Net-SSLeay NET_SSLEAY_VERSION build-perl-al2023.sh
update Carton CARTON_VERSION build-perl-al2023.sh
update AWS-XRay AWS_XRAY_VERSION build-perl-al2023.sh
update JSON JSON_VERSION build-perl-al2023.sh
update JSON-XS JSON_XS_VERSION build-perl-al2023.sh
update Cpanel-JSON-XS CPANEL_JSON_XS_VERSION build-perl-al2023.sh
update JSON-MaybeXS JSON_MAYBEXS_VERSION build-perl-al2023.sh
update YAML YAML_VERSION build-perl-al2023.sh
update YAML-Tiny YAML_TINY_VERSION build-perl-al2023.sh
update YAML-LibYAML YAML_XS_VERSION build-perl-al2023.sh
update IO-Socket-SSL IO_SOCKET_SSL_VERSION build-perl-al2023.sh
update Mozilla-CA MOZILLA_CA_VERSION build-perl-al2023.sh
update local-lib LOCAL_LIB_VERSION build-perl-al2023.sh

update Paws PAWS_VERSION build-paws-al2023.sh

cpanfile  view on Meta::CPAN

requires 'perl', '5.026000';
requires 'HTTP::Tiny', '0.076';
requires 'JSON::XS', '4.0';
requires 'Try::Tiny', '0.30';
requires 'Plack', '1.0047';
requires 'Plack::Middleware::ReverseProxy', '0.16';
requires 'JSON::Types', '0.05';
requires 'URI::Escape';
requires 'MIME::Base64';
requires 'Parallel::Prefork';

recommends 'AWS::XRay', '>=0.09';

on 'test' => sub {
    requires 'Test::More', '0.98';
    requires 'Test::Deep', '1.128';
    requires 'Test::TCP', '2.19';

lib/AWS/Lambda.pm  view on Meta::CPAN

=head2 Pre-installed modules

The following modules are pre-installed for convenience.

=over

=item L<AWS::Lambda>

=item L<AWS::XRay>

=item L<JSON>

=item L<Cpanel::JSON::XS>

=item L<JSON::MaybeXS>

=item L<YAML>

=item L<YAML::Tiny>

=item L<YAML::XS>

=item L<Net::SSLeay>

=item L<IO::Socket::SSL>

lib/AWS/Lambda/AL.pm  view on Meta::CPAN

=head2 Pre-installed modules

The following modules are pre-installed for convenience.

=over

=item L<AWS::Lambda>

=item L<AWS::XRay>

=item L<JSON>

=item L<Cpanel::JSON::XS>

=item L<JSON::MaybeXS>

=item L<YAML>

=item L<YAML::Tiny>

=item L<YAML::XS>

=item L<Net::SSLeay>

=item L<IO::Socket::SSL>

lib/AWS/Lambda/AL2.pm  view on Meta::CPAN

=head2 Pre-installed modules

The following modules are pre-installed for convenience.

=over

=item L<AWS::Lambda>

=item L<AWS::XRay>

=item L<JSON>

=item L<Cpanel::JSON::XS>

=item L<JSON::MaybeXS>

=item L<YAML>

=item L<YAML::Tiny>

=item L<YAML::XS>

=item L<Net::SSLeay>

=item L<IO::Socket::SSL>

lib/AWS/Lambda/AL2023.pm  view on Meta::CPAN

=head2 Pre-installed modules

The following modules are pre-installed for convenience.

=over

=item L<AWS::Lambda>

=item L<AWS::XRay>

=item L<JSON>

=item L<Cpanel::JSON::XS>

=item L<JSON::MaybeXS>

=item L<YAML>

=item L<YAML::Tiny>

=item L<YAML::XS>

=item L<Net::SSLeay>

=item L<IO::Socket::SSL>

lib/AWS/Lambda/Bootstrap.pm  view on Meta::CPAN

package AWS::Lambda::Bootstrap;
use 5.026000;
use utf8;
use strict;
use warnings;
use HTTP::Tiny;
use JSON::XS qw/decode_json encode_json/;
use Try::Tiny;
use AWS::Lambda;
use AWS::Lambda::Context;
use AWS::Lambda::ResponseWriter;
use Scalar::Util qw(blessed);
use Exporter 'import';

our @EXPORT = ('bootstrap');

sub bootstrap {

lib/AWS/Lambda/PSGI.pm  view on Meta::CPAN

package AWS::Lambda::PSGI;
use 5.026000;
use utf8;
use strict;
use warnings;
use URI::Escape;
use Plack::Util;
use bytes ();
use MIME::Base64;
use JSON::Types;
use Encode;
use Try::Tiny;
use Plack::Middleware::ReverseProxy;
use AWS::Lambda;
use Scalar::Util qw(reftype);
use JSON::XS qw(encode_json);

sub new {
    my $proto = shift;
    my $class = ref $proto || $proto;
 
    my $self;
    if (@_ == 1 && ref $_[0] eq 'HASH') {
        $self = bless {%{$_[0]}}, $class;
    } else {
        $self = bless {@_}, $class;

t/11_lambda_response.t  view on Meta::CPAN


use Test::More;
use Test::TCP;
use HTTP::Server::PSGI;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;

my $app_server = Test::TCP->new(
    listen => 1,
    code => sub {
        my $sock = shift;
        my $server = HTTP::Server::PSGI->new(
            listen_sock => $sock,
        );
        $server->run(sub {
            my $env = shift;

t/12_lambda_error.t  view on Meta::CPAN


use Test::More;
use Test::TCP;
use HTTP::Server::PSGI;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;

my $app_server = Test::TCP->new(
    listen => 1,
    code => sub {
        my $sock = shift;
        my $server = HTTP::Server::PSGI->new(
            listen_sock => $sock,
        );
        $server->run(sub {
            my $env = shift;

t/13_lambda_init_error.t  view on Meta::CPAN


use Test::More;
use Test::TCP;
use HTTP::Server::PSGI;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;

my $app_server = Test::TCP->new(
    listen => 1,
    code => sub {
        my $sock = shift;
        my $server = HTTP::Server::PSGI->new(
            listen_sock => $sock,
        );
        $server->run(sub {
            my $env = shift;

t/15_lambda_response_streaming.t  view on Meta::CPAN


use Test::More;
use Test::TCP;
use Starman::Server;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;

sub slurp {
    my $fh = shift;
    my $data = "";
    while ($fh->read(my $buf, 4096)) {
        $data .= $buf;
    }
    return $data;
}

t/20_psgi.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;

use Test::More;
use FindBin;
use JSON::XS qw/decode_json encode_json/;
use File::Slurp qw(slurp);
use Plack::Request;
use Test::Deep qw(cmp_deeply);
use Test::Warn;
use JSON::Types;
use Encode;

use AWS::Lambda::Context;
use AWS::Lambda::PSGI;

sub slurp_json {
    my $name = $_[0];
    return decode_json(slurp("$FindBin::Bin/$name"));
}

t/21_psgi_response_streaming.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;

use Test::More;
use FindBin;
use JSON::XS qw/decode_json encode_json/;
use File::Slurp qw(slurp);
use Plack::Request;
use Test::Deep qw(cmp_deeply);
use Test::Warn;
use JSON::Types;
use Encode;

use AWS::Lambda::Context;
use AWS::Lambda::PSGI;

sub slurp_json {
    my $name = $_[0];
    return decode_json(slurp("$FindBin::Bin/$name"));
}

xt/21_mojo.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;

use Test::More;
use JSON::XS qw/decode_json/;

use AWS::Lambda::PSGI;
use Mojo::Server::PSGI;

my $get_request_for_get_link = <<EOF;
{
    "resource": "/{proxy+}",
    "path": "/get-link",
    "httpMethod": "GET",
    "headers": {

xt/21_mojo_custom_domain.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;

use Test::More;
use JSON::XS qw/decode_json/;

use AWS::Lambda::PSGI;
use Mojo::Server::PSGI;

my $get_request_for_get_link = <<EOF;
{
    "resource": "/{proxy+}",
    "path": "/get-link",
    "httpMethod": "GET",
    "headers": {

xt/22_dancer.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;

use Test::More;
use JSON::XS qw/decode_json/;

use AWS::Lambda::PSGI;

my $get_request_for_get_link = <<EOF;
{
    "resource": "/{proxy+}",
    "path": "/get-link",
    "httpMethod": "GET",
    "headers": {
        "Host": "xxxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com",



( run in 1.392 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )