AWS-Lambda

 view release on metacpan or  search on metacpan

author/perl-stripper/perl-stripper/handler.pl  view on Meta::CPAN

use v5.36;
use utf8;
use lib "$ENV{'LAMBDA_TASK_ROOT'}/local/lib/perl5";
use lib "$ENV{'LAMBDA_TASK_ROOT'}/local/lib/perl5/aarch64-linux";

use Perl::Strip;
use Plack::Request;
use AWS::Lambda::PSGI;

mkdir '/tmp/.perl-strip';
my $stripper = Perl::Strip->new(
    cache => '/tmp/.perl-strip',
    optimise_size => 1,
);

examples/cgi/WwwCounter/handler.pl  view on Meta::CPAN

use utf8;
use warnings;
use strict;
use lib "$ENV{'LAMBDA_TASK_ROOT'}/local/lib/perl5";
use AWS::Lambda::PSGI;

$ENV{WWWCOUNT_DIR} ||= "/tmp";
chdir($ENV{'LAMBDA_TASK_ROOT'});
my $app = require "$ENV{'LAMBDA_TASK_ROOT'}/app.psgi";
my $func = AWS::Lambda::PSGI->wrap($app);

sub handle {
    my $payload = shift;
    return $func->($payload);

examples/s3-get-object/handler.pl  view on Meta::CPAN

use utf8;
use warnings;
use strict;
use 5.30.0;
use lib "$ENV{'LAMBDA_TASK_ROOT'}/extlocal/lib/perl5";
use Paws;
use Try::Tiny;
use URI::Escape;

my $obj = Paws->service('S3', region => 'ap-northeast-1');

sub handle {
    my $payload = shift;
    # Get the object from the event and show its content type
    my $bucket = $payload->{Records}[0]{s3}{bucket}{name};

t/01_echo.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;

use Test::More;
use Test::Deep;

use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;

my $payload = +{
    key1 => 1,
    key2 => 2,
    key3 => 3,
};
my $response;
my $context;

t/02_error.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;
use Test::More;

use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;

my $error;
my $bootstrap = BootstrapMock->new(
    handler     => "error.handle",
    runtime_api => "example.com",
    task_root   => "$FindBin::Bin/test_handlers",
    lambda_next => sub {
        return +{
            key1 => 1,

t/03_init_error.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;
use Test::More;

use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;
use Try::Tiny;

my $error;
my $bootstrap = BootstrapMock->new(
    handler     => "init_error.handle",
    runtime_api => "example.com",
    task_root   => "$FindBin::Bin/test_handlers",
    lambda_init_error => sub {

t/04_handler_not_found.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;
use Test::More;

use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;
use Try::Tiny;

my $error;
my $bootstrap = BootstrapMock->new(
    handler     => "echo.handle_not_found",
    runtime_api => "example.com",
    task_root   => "$FindBin::Bin/test_handlers",
    lambda_init_error => sub {

t/14_streaming.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;

use Test::More;
use Test::Deep;

use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;

my $payload = +{
    key1 => 1,
    key2 => 2,
    key3 => 3,
};
my $response;
my $context;



( run in 0.406 second using v1.01-cache-2.11-cpan-87723dcf8b7 )