AWS-Lambda-Quick

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "requires" : {
            "Code::TidyAll::Plugin::Test::Vars" : "0.02",
            "File::Spec" : "0",
            "IO::Handle" : "0",
            "IPC::Open3" : "0",
            "Parallel::ForkManager" : "1.19",
            "Perl::Critic" : "1.126",
            "Perl::Tidy" : "20160302",
            "Pod::Wordlist" : "0",
            "Test::CPAN::Changes" : "0.19",
            "Test::CPAN::Meta::JSON" : "0.16",
            "Test::Code::TidyAll" : "0.50",
            "Test::EOL" : "0",
            "Test::Mojibake" : "0",
            "Test::More" : "0.96",
            "Test::NoTabs" : "0",
            "Test::Pod" : "1.41",
            "Test::Portability::Files" : "0",
            "Test::Spelling" : "0.12",
            "Test::Vars" : "0.009",
            "Test::Version" : "2.05",
            "perl" : "5.006"
         }
      },
      "runtime" : {
         "requires" : {
            "AWS::CLIWrapper" : "0",
            "Archive::Zip" : "0",
            "File::Temp" : "0",
            "JSON::PP" : "0",
            "Mo" : "0",
            "Path::Tiny" : "0",
            "autodie" : "0",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "recommends" : {
            "CPAN::Meta" : "2.120900"

META.json  view on Meta::CPAN

            "class" : "Dist::Zilla::Plugin::Meta::Contributors",
            "name" : "@MAXMIND/Meta::Contributors",
            "version" : "0.003"
         },
         {
            "class" : "Dist::Zilla::Plugin::MetaConfig",
            "name" : "@MAXMIND/MetaConfig",
            "version" : "6.012"
         },
         {
            "class" : "Dist::Zilla::Plugin::MetaJSON",
            "name" : "@MAXMIND/MetaJSON",
            "version" : "6.012"
         },
         {
            "class" : "Dist::Zilla::Plugin::MetaYAML",
            "name" : "@MAXMIND/MetaYAML",
            "version" : "6.012"
         },
         {
            "class" : "Dist::Zilla::Plugin::NextRelease",
            "name" : "@MAXMIND/NextRelease",

META.json  view on Meta::CPAN

            "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes",
            "config" : {
               "Dist::Zilla::Plugin::Test::CPAN::Changes" : {
                  "changelog" : "Changes"
               }
            },
            "name" : "@MAXMIND/Test::CPAN::Changes",
            "version" : "0.012"
         },
         {
            "class" : "Dist::Zilla::Plugin::Test::CPAN::Meta::JSON",
            "name" : "@MAXMIND/Test::CPAN::Meta::JSON",
            "version" : "0.004"
         },
         {
            "class" : "Dist::Zilla::Plugin::Test::EOL",
            "config" : {
               "Dist::Zilla::Plugin::Test::EOL" : {
                  "filename" : "xt/author/eol.t",
                  "finder" : [
                     ":ExecFiles",
                     ":InstallModules",

META.json  view on Meta::CPAN

      "zilla" : {
         "class" : "Dist::Zilla::Dist::Builder",
         "config" : {
            "is_trial" : 0
         },
         "version" : "6.012"
      }
   },
   "x_authority" : "cpan:MAXMIND",
   "x_generated_by_perl" : "v5.28.1",
   "x_serialization_backend" : "Cpanel::JSON::XS version 4.08"
}

META.yml  view on Meta::CPAN

  AWS::Lambda::Quick::Processor:
    file: lib/AWS/Lambda/Quick/Processor.pm
    version: '1.0002'
  AWS::Lambda::Quick::Upload:
    file: lib/AWS/Lambda/Quick/Upload.pm
    version: '1.0002'
requires:
  AWS::CLIWrapper: '0'
  Archive::Zip: '0'
  File::Temp: '0'
  JSON::PP: '0'
  Mo: '0'
  Path::Tiny: '0'
  autodie: '0'
  strict: '0'
  warnings: '0'
resources:
  bugtracker: https://github.com/2shortplanks/aws-lambda-quick/issues
  homepage: http://metacpan.org/release/AWS-Lambda-Quick
  repository: git://github.com/2shortplanks/aws-lambda-quick.git
version: '1.0002'

META.yml  view on Meta::CPAN

      version: '2.004003'
    -
      class: Dist::Zilla::Plugin::Meta::Contributors
      name: '@MAXMIND/Meta::Contributors'
      version: '0.003'
    -
      class: Dist::Zilla::Plugin::MetaConfig
      name: '@MAXMIND/MetaConfig'
      version: '6.012'
    -
      class: Dist::Zilla::Plugin::MetaJSON
      name: '@MAXMIND/MetaJSON'
      version: '6.012'
    -
      class: Dist::Zilla::Plugin::MetaYAML
      name: '@MAXMIND/MetaYAML'
      version: '6.012'
    -
      class: Dist::Zilla::Plugin::NextRelease
      name: '@MAXMIND/NextRelease'
      version: '6.012'
    -

META.yml  view on Meta::CPAN

      name: '@MAXMIND/MojibakeTests'
      version: '0.8'
    -
      class: Dist::Zilla::Plugin::Test::CPAN::Changes
      config:
        Dist::Zilla::Plugin::Test::CPAN::Changes:
          changelog: Changes
      name: '@MAXMIND/Test::CPAN::Changes'
      version: '0.012'
    -
      class: Dist::Zilla::Plugin::Test::CPAN::Meta::JSON
      name: '@MAXMIND/Test::CPAN::Meta::JSON'
      version: '0.004'
    -
      class: Dist::Zilla::Plugin::Test::EOL
      config:
        Dist::Zilla::Plugin::Test::EOL:
          filename: xt/author/eol.t
          finder:
            - ':ExecFiles'
            - ':InstallModules'
            - ':TestFiles'

Makefile.PL  view on Meta::CPAN

  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "AWS-Lambda-Quick",
  "LICENSE" => "perl",
  "NAME" => "AWS::Lambda::Quick",
  "PREREQ_PM" => {
    "AWS::CLIWrapper" => 0,
    "Archive::Zip" => 0,
    "File::Temp" => 0,
    "JSON::PP" => 0,
    "Mo" => 0,
    "Path::Tiny" => 0,
    "autodie" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Exporter" => 0,
    "ExtUtils::MakeMaker" => 0,
    "File::Spec" => 0,

Makefile.PL  view on Meta::CPAN


my %FallbackPrereqs = (
  "AWS::CLIWrapper" => 0,
  "Archive::Zip" => 0,
  "Exporter" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::Spec" => 0,
  "File::Temp" => 0,
  "FindBin" => 0,
  "HTTP::Tiny" => 0,
  "JSON::PP" => 0,
  "Mo" => 0,
  "Path::Tiny" => 0,
  "Test2::V0" => 0,
  "Test::More" => "1.302015",
  "Test::TempDir::Tiny" => 0,
  "autodie" => 0,
  "base" => 0,
  "lib" => 0,
  "strict" => 0,
  "warnings" => 0

README.md  view on Meta::CPAN

through to our handler as the first argument.

Upload and GET the following to see what is being passed in
your environment:

    #!/usr/bin/perl

    use strict;
    use warnings;

    use JSON::PP;

    use AWS::Lambda::Quick (
        name => 'echo',
    );

    sub handler {
        my $data = shift;
        return {
            statusCode => 200,
            headers => {

cpanfile  view on Meta::CPAN

requires "AWS::CLIWrapper" => "0";
requires "Archive::Zip" => "0";
requires "File::Temp" => "0";
requires "JSON::PP" => "0";
requires "Mo" => "0";
requires "Path::Tiny" => "0";
requires "autodie" => "0";
requires "strict" => "0";
requires "warnings" => "0";

on 'test' => sub {
  requires "Exporter" => "0";
  requires "ExtUtils::MakeMaker" => "0";
  requires "File::Spec" => "0";

cpanfile  view on Meta::CPAN

on 'develop' => sub {
  requires "Code::TidyAll::Plugin::Test::Vars" => "0.02";
  requires "File::Spec" => "0";
  requires "IO::Handle" => "0";
  requires "IPC::Open3" => "0";
  requires "Parallel::ForkManager" => "1.19";
  requires "Perl::Critic" => "1.126";
  requires "Perl::Tidy" => "20160302";
  requires "Pod::Wordlist" => "0";
  requires "Test::CPAN::Changes" => "0.19";
  requires "Test::CPAN::Meta::JSON" => "0.16";
  requires "Test::Code::TidyAll" => "0.50";
  requires "Test::EOL" => "0";
  requires "Test::Mojibake" => "0";
  requires "Test::More" => "0.96";
  requires "Test::NoTabs" => "0";
  requires "Test::Pod" => "1.41";
  requires "Test::Portability::Files" => "0";
  requires "Test::Spelling" => "0.12";
  requires "Test::Vars" => "0.009";
  requires "Test::Version" => "2.05";

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

through to our handler as the first argument.

Upload and GET the following to see what is being passed in
your environment:

    #!/usr/bin/perl

    use strict;
    use warnings;

    use JSON::PP;

    use AWS::Lambda::Quick (
        name => 'echo',
    );

    sub handler {
        my $data = shift;
        return {
            statusCode => 200,
            headers => {

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

package AWS::Lambda::Quick::Upload;
use Mo qw( default required );

our $VERSION = '1.0002';

use AWS::CLIWrapper;
use JSON::PP ();

### required attributes

has zip_filename => required => 1;
has name         => required => 1;

### optional attributes wrt the lambda function itself

has extra_layers => default => [];
has region       => default => 'us-east-1';

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

    }

    $self->debug('creating new role');
    $result = $self->aws_do(
        'iam',
        'create-role',
        {
            'role-name' => $self->role,
            'description' =>
                'Role for lambda functions created by AWS::Lambda::Quick. See https://metacpan.org/pod/AWS::Lambda::Quick for more info.',
            'assume-role-policy-document' => <<'JSON',
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
                "Service": [
                    "lambda.amazonaws.com",
                    "apigateway.amazonaws.com"
                ]
            }
        }
    ]
}
JSON
        }
    );
    $self->debug('new role created');
    $self->debug('attaching permissions to role');
    $self->aws_do(
        'iam',
        'attach-role-policy',
        {
            'policy-arn' =>
                'arn:aws:iam::aws:policy/service-role/AWSLambdaRole',

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

    # uh oh, something went wrong, throw exception

    ## no critic (ProhibitPackageVars)
    my $code    = $AWS::CLIWrapper::Error->{Code};
    my $message = $AWS::CLIWrapper::Error->{Message};

    die "AWS CLI failure when calling $method $_[0] '$code': $message";
}

sub encode_json($) {
    return JSON::PP->new->ascii->canonical(1)->allow_nonref(1)->encode(shift);
}

sub debug {
    my $self = shift;
    return unless $ENV{AWS_LAMBDA_QUICK_DEBUG};
    for (@_) {
        print STDERR "$_\n" or die "Can't write to fh: $!";
    }
    return ();
}

t/00-report-prereqs.dd  view on Meta::CPAN

                      'requires' => {
                                      'Code::TidyAll::Plugin::Test::Vars' => '0.02',
                                      'File::Spec' => '0',
                                      'IO::Handle' => '0',
                                      'IPC::Open3' => '0',
                                      'Parallel::ForkManager' => '1.19',
                                      'Perl::Critic' => '1.126',
                                      'Perl::Tidy' => '20160302',
                                      'Pod::Wordlist' => '0',
                                      'Test::CPAN::Changes' => '0.19',
                                      'Test::CPAN::Meta::JSON' => '0.16',
                                      'Test::Code::TidyAll' => '0.50',
                                      'Test::EOL' => '0',
                                      'Test::Mojibake' => '0',
                                      'Test::More' => '0.96',
                                      'Test::NoTabs' => '0',
                                      'Test::Pod' => '1.41',
                                      'Test::Portability::Files' => '0',
                                      'Test::Spelling' => '0.12',
                                      'Test::Vars' => '0.009',
                                      'Test::Version' => '2.05',
                                      'perl' => '5.006'
                                    }
                    },
       'runtime' => {
                      'requires' => {
                                      'AWS::CLIWrapper' => '0',
                                      'Archive::Zip' => '0',
                                      'File::Temp' => '0',
                                      'JSON::PP' => '0',
                                      'Mo' => '0',
                                      'Path::Tiny' => '0',
                                      'autodie' => '0',
                                      'strict' => '0',
                                      'warnings' => '0'
                                    }
                    },
       'test' => {
                   'recommends' => {
                                     'CPAN::Meta' => '2.120900'

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

ok( $z->read( $zip_filename->stringify ) == AZ_OK, 'read zip okay' );

is( $z->contents('handler.pl'), <<'PERL', 'hander.pl was stored ok' );
BEGIN{$INC{'AWS/Lambda/Quick.pm'}=1} use AWS::Lambda::Quick (
    name => 'whatever',
    extra_files => 'lib',
);

use lib qw(lib);
use Greeting;
use JSON::PP qw( encode_json );

sub handler {
    my $data = shift;

    return {
        statusCode => 200,
        headers => {
            'Content-Type' => 'text/plain',
        },
        body => Greeting->greeting( $data->{queryStringParameters}{who} ),

t/lib/TestHelper/CreateTestFiles.pm  view on Meta::CPAN


    # the main source file
    path( $dir, 'handler.pl' )->spew(<<'PERL');
use AWS::Lambda::Quick (
    name => 'whatever',
    extra_files => 'lib',
);

use lib qw(lib);
use Greeting;
use JSON::PP qw( encode_json );

sub handler {
    my $data = shift;

    return {
        statusCode => 200,
        headers => {
            'Content-Type' => 'text/plain',
        },
        body => Greeting->greeting( $data->{queryStringParameters}{who} ),

xt/release/meta-json.t  view on Meta::CPAN

#!perl

use Test::CPAN::Meta::JSON;
meta_json_ok();



( run in 1.209 second using v1.01-cache-2.11-cpan-140bd7fdf52 )