AWS-Lambda

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

Build.PL
Changes
LICENSE
META.json
README.md
author/build-paws-al2023.sh
author/build-paws-layer-al2023.sh
author/build-perl-al2023.sh
author/build-perl-runtime-al2023.sh
author/cfn-layer-paws-al2023-arm64.yml
author/cfn-layer-paws-al2023-x86_64.yml
author/cfn-layer-runtime-al2023-arm64.yml
author/cfn-layer-runtime-al2023-x86_64.yml
author/cfn-s3.yml
author/deploy-s3-stack.sh
author/perl-stripper/Makefile
author/perl-stripper/perl-stripper/Makefile
author/perl-stripper/perl-stripper/cpanfile
author/perl-stripper/perl-stripper/cpanfile.snapshot
author/perl-stripper/perl-stripper/handler.pl
author/perl-stripper/samconfig.toml
author/perl-stripper/template.yaml
author/perlstrip.sh
author/pod-stripper/cpanfile
author/pod-stripper/scripts/pod_stripper.pl
author/publish-perl-runtime-archives.pl
author/publish-perl-runtimes.pl
author/regions-arm64.txt
author/regions-x86_64.txt
author/update-aws-lambda-al.pl
author/update-aws-lambda-al2.pl
author/update-aws-lambda-al2023.pl
author/update-dependencies.sh
author/validate-account.sh
author/validate-template.sh
cpanfile
examples/cgi/Makefile
examples/cgi/README.md
examples/cgi/WwwCounter/0.gif
examples/cgi/WwwCounter/1.gif
examples/cgi/WwwCounter/2.gif
examples/cgi/WwwCounter/3.gif
examples/cgi/WwwCounter/4.gif
examples/cgi/WwwCounter/5.gif
examples/cgi/WwwCounter/6.gif

META.json  view on Meta::CPAN

{
   "abstract" : "Perl support for AWS Lambda Custom Runtime.",
   "author" : [
      "ICHINOSE Shogo"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Minilla/v3.1.29",
   "license" : [
      "mit"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : "2"
   },
   "name" : "AWS-Lambda",
   "no_index" : {
      "directory" : [
         "t",
         "xt",
         "inc",
         "share",
         "eg",
         "examples",
         "author",
         "builder"
      ]
   },
   "prereqs" : {
      "configure" : {
         "requires" : {
            "Module::Build::Tiny" : "0.035"
         }
      },
      "develop" : {

META.yml  view on Meta::CPAN

---
abstract: 'Perl support for AWS Lambda Custom Runtime.'
author:
  - 'ICHINOSE Shogo'
build_requires:
  File::Slurp: '9999.25'
  Starman: '0'
  Test::Deep: '1.128'
  Test::More: '0.98'
  Test::SharedFork: '0'
  Test::TCP: '2.19'
  Test::Warn: '0'
configure_requires:

META.yml  view on Meta::CPAN

  version: '1.4'
name: AWS-Lambda
no_index:
  directory:
    - t
    - xt
    - inc
    - share
    - eg
    - examples
    - author
    - builder
provides:
  AWS::Lambda:
    file: lib/AWS/Lambda.pm
    version: v0.11.0
  AWS::Lambda::AL:
    file: lib/AWS/Lambda/AL.pm
    version: v0.11.0
  AWS::Lambda::AL2:
    file: lib/AWS/Lambda/AL2.pm

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

    *) echo "unknown platform: $PLATFORM";
    exit 1;;
esac

docker run \
    -v "$ROOT:/var/task" \
    -v "$OPT-$PLATFORM/lib/perl5/site_perl:/opt/lib/perl5/site_perl" \
    -v "$OPT-$PLATFORM/lib:/opt-lib" \
    --platform "$DOCKER_PLATFORM" \
    "public.ecr.aws/sam/build-provided.al2023:1-$PLATFORM" \
    ./author/build-paws-al2023.sh "$TAG"

find "$OPT-$PLATFORM" -type f -a -name '*.pm' -print0 | parallel -0 -j 32 "$ROOT/author/perlstrip.sh"

cd "$OPT-$PLATFORM"
mkdir -p "$DIST"
zip -9 -r "$DIST/perl-$TAG-paws-al2023-$PLATFORM.zip" .

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

    "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/
perl -i -pe 's(^#!perl$)(#!/opt/bin/perl)' /opt/bootstrap

# remove POD(Plain Old Documentation)
dnf install -y perl-ExtUtils-MakeMaker
cd author/pod-stripper
perl /opt/bin/cpanm --installdeps --notest .
perl ./scripts/pod_stripper.pl /opt/lib/perl5

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

    *) echo "unknown platform: $PLATFORM";
    exit 1;;
esac

# build the perl binary
docker run \
    -v "$ROOT:/var/task" \
    -v "$OPT-$PLATFORM:/opt" \
    --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 ''

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

printfh(<<'EOS');
package AWS::Lambda::AL;
use 5.026000;
use strict;
use warnings;

our $VERSION = "@@VERSION@@";

EOS

print $fh "# This list is auto generated by authors/update-aws-lambda-al.pl; DO NOT EDIT\n";
print $fh "our \$LAYERS = {\n";
for my $version (@$versions) {
    print $fh "    '$version' => {\n";
    for my $region (@{$regions->{x86_64}}) {
        next unless $layers->{$version}{$region}{runtime_arn};
        print $fh <<EOS
        '$region' => {
            runtime_arn     => "$layers->{$version}{$region}{runtime_arn}",
            runtime_version => $layers->{$version}{$region}{runtime_version},
            paws_arn        => "$layers->{$version}{$region}{paws_arn}",

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

printfh(<<'EOS');
package AWS::Lambda::AL2;
use 5.026000;
use strict;
use warnings;

our $VERSION = "@@VERSION@@";

EOS

print $fh "# This list is auto generated by authors/update-aws-lambda-al2.pl; DO NOT EDIT\n";
print $fh "our \$LAYERS = {\n";
for my $version (@$versions_al2) {
    print $fh "    '$version' => {\n";
    for my $arch (@$archs) {
        print $fh "        '$arch' => {\n";
        for my $region (@{$regions->{$arch}}) {
            next unless $layers_al2->{$version}{$region}{$arch}{runtime_arn};
            print $fh <<EOS
            '$region' => {
                runtime_arn     => "$layers_al2->{$version}{$region}{$arch}{runtime_arn}",

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

printfh(<<'EOS');
package AWS::Lambda::AL2023;
use 5.026000;
use strict;
use warnings;

our $VERSION = "@@VERSION@@";

EOS

print $fh "# This list is auto generated by authors/update-aws-lambda-al2023.pl; DO NOT EDIT\n";
print $fh "our \$LAYERS = {\n";
for my $version (@$versions_al2023) {
    print $fh "    '$version' => {\n";
    for my $arch (@$archs) {
        print $fh "        '$arch' => {\n";
        for my $region (@{$regions->{$arch}}) {
            next unless $layers_al2023->{$version}{$region}{$arch}{runtime_arn};
            print $fh <<EOS
            '$region' => {
                runtime_arn     => "$layers_al2023->{$version}{$region}{$arch}{runtime_arn}",

examples/cgi/Makefile  view on Meta::CPAN

.PHONY: build
build:
	sam build

.PHONY: deploy
deploy:
	sam deploy

.PHONY: author
author:
	sam deploy --config-env author

examples/cgi/README.md  view on Meta::CPAN

# An example of CGI Application

It is an example of [Common Gateway Interface](https://en.wikipedia.org/wiki/Common_Gateway_Interface) application.
Demo program comes from [WwwCounter](https://www.tohoho-web.com/soft/wwwcounter/readme.html) authored by [杜甫々](https://www.tohoho-web.com/wwwwho.html)(tohoho).

The example is built as [AWS Serverless Application Model](https://aws.amazon.com/serverless/sam/)(SAM).
Install SAM CLI and run the following commands.

```console
make build
sam deploy --guide
```

examples/cgi/samconfig.toml  view on Meta::CPAN

version = 0.1
[author]
[author.deploy]
[author.deploy.parameters]
stack_name = "www-counter"
s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-10nboesix5it7"
s3_prefix = "www-counter"
region = "ap-northeast-1"
confirm_changeset = true
capabilities = "CAPABILITY_IAM"

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

package AWS::Lambda::AL;
use 5.026000;
use strict;
use warnings;

our $VERSION = "0.11.0";

# This list is auto generated by authors/update-aws-lambda-al.pl; DO NOT EDIT
our $LAYERS = {
    '5.38' => {
        'af-south-1' => {
            runtime_arn     => "arn:aws:lambda:af-south-1:445285296882:layer:perl-5-38-runtime:1",
            runtime_version => 1,
            paws_arn        => "arn:aws:lambda:af-south-1:445285296882:layer:perl-5-38-paws:1",
            paws_version    => 1,
        },
        'ap-east-1' => {
            runtime_arn     => "arn:aws:lambda:ap-east-1:445285296882:layer:perl-5-38-runtime:1",

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

package AWS::Lambda::AL2;
use 5.026000;
use strict;
use warnings;

our $VERSION = "0.11.0";

# This list is auto generated by authors/update-aws-lambda-al2.pl; DO NOT EDIT
our $LAYERS = {
    '5.42' => {
        'x86_64' => {
            'af-south-1' => {
                runtime_arn     => "arn:aws:lambda:af-south-1:445285296882:layer:perl-5-42-runtime-al2-x86_64:2",
                runtime_version => 2,
                paws_arn        => "arn:aws:lambda:af-south-1:445285296882:layer:perl-5-42-paws-al2-x86_64:1",
                paws_version    => 1,
            },
            'ap-east-1' => {

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

package AWS::Lambda::AL2023;
use 5.026000;
use strict;
use warnings;

our $VERSION = "0.11.0";

# This list is auto generated by authors/update-aws-lambda-al2023.pl; DO NOT EDIT
our $LAYERS = {
    '5.44' => {
        'x86_64' => {
            'af-south-1' => {
                runtime_arn     => "arn:aws:lambda:af-south-1:445285296882:layer:perl-5-44-runtime-al2023-x86_64:2",
                runtime_version => 2,
                paws_arn        => "arn:aws:lambda:af-south-1:445285296882:layer:perl-5-44-paws-al2023-x86_64:1",
                paws_version    => 1,
            },
            'ap-east-1' => {

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

        handle       => undef,
        closed       => 0,
    }, $class;
    return $self;
}

sub _request {
    my ($self, $content_type) = @_;
    my $response_url = $self->{response_url};
    my $http = $self->{http};
    my ($scheme, $host, $port, $path_query, $auth) = $http->_split_url($response_url);
    my $host_port = ($port == $DefaultPort{$scheme} ? $host : "$host:$port");
    my $request = {
        method    => "POST",
        scheme    => $scheme,
        host      => $host,
        port      => $port,
        host_port => $host_port,
        uri       => $path_query,
        headers   => {
            "host"              => $host_port,



( run in 2.011 seconds using v1.01-cache-2.11-cpan-5c0b1e786e0 )