AWS-Lambda-Quick

 view release on metacpan or  search on metacpan

CONTRIBUTING.md  view on Meta::CPAN

    $ dzil test
    $ dzil test --release
    $ dzil xtest
    $ dzil listdeps --json
    $ dzil build --notgz

You can learn more about Dist::Zilla at http://dzil.org/.

The code for this distribution is [hosted at GitHub](https://github.com/2shortplanks/aws-lambda-quick).

You can submit code changes by forking the repository, pushing your code
changes to your clone, and then submitting a pull request. Detailed
instructions for doing that is available here:

https://help.github.com/articles/creating-a-pull-request

If you have found a bug, but do not have an accompanying patch to fix it, you
can submit an issue report [via the web](https://github.com/2shortplanks/aws-lambda-quick/issues)
.
This is a good place to send your questions about the usage of this distribution.


## Tidyall

This distribution uses
[Code::TidyAll](https://metacpan.org/release/Code-TidyAll) to enforce a
uniform coding style. This is tested as part of the author testing suite. You
can install and run tidyall by running the following commands:

    $ cpanm Code::TidyAll
    $ tidyall -a

Please run this before committing your changes and address any issues it
brings up.

## Contributor Names

If you send a patch or pull request, your name and email address will be
included in the documentation as a contributor (using the attribution on the
commit or patch), unless you specifically request for it not to be. If you
wish to be listed under a different name or address, you should submit a pull
request to the .mailmap file to contain the correct mapping.
[Check here](https://github.com/git/git/blob/master/Documentation/mailmap.txt)

LICENSE  view on Meta::CPAN

 Copyright (C) 1989 Free Software Foundation, Inc.
 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The license agreements of most software companies try to keep users
at the mercy of those companies.  By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the

LICENSE  view on Meta::CPAN

General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program.  You may charge a fee for the physical act of
transferring a copy.

  2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:

    a) cause the modified files to carry prominent notices stating that
    you changed the files and the date of any change; and

    b) cause the whole of any work that you distribute or publish, that
    in whole or in part contains the Program or any part thereof, either
    with or without modifications, to be licensed at no charge to all
    third parties under the terms of this General Public License (except
    that you may choose to grant warranty protection to some or all
    third parties, at your option).

    c) If the modified program normally reads commands interactively when
    run, you must cause it, when started running for such interactive use
    in the simplest and most usual way, to print or display an
    announcement including an appropriate copyright notice and a notice
    that there is no warranty (or else, saying that you provide a
    warranty) and that users may redistribute the program under these
    conditions, and telling the user how to view a copy of this General
    Public License.

    d) You may charge a fee for the physical act of transferring a
    copy, and you may at your option offer warranty protection in
    exchange for a fee.

Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.

  3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:

    a) accompany it with the complete corresponding machine-readable

LICENSE  view on Meta::CPAN

YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

LICENSE  view on Meta::CPAN


1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.

3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:

  a) place your modifications in the Public Domain or otherwise make them
     Freely Available, such as by posting said modifications to Usenet or an
     equivalent medium, or placing the modifications on a major archive site
     such as ftp.uu.net, or by allowing the Copyright Holder to include your
     modifications in the Standard Version of the Package.

  b) use the modified Package only within your corporation or organization.

  c) rename any non-standard executables so the names do not conflict with

MANIFEST  view on Meta::CPAN

tidyall.ini
xt/author/00-compile.t
xt/author/eol.t
xt/author/mojibake.t
xt/author/no-tabs.t
xt/author/pod-spell.t
xt/author/pod-syntax.t
xt/author/portability.t
xt/author/test-version.t
xt/author/tidyall.t
xt/release/cpan-changes.t
xt/release/meta-json.t

META.json  view on Meta::CPAN

         },
         {
            "class" : "Dist::Zilla::Plugin::MojibakeTests",
            "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"
         },

META.json  view on Meta::CPAN

                  "allow_dirty" : [
                     "CONTRIBUTING.md",
                     "Changes",
                     "LICENSE",
                     "Makefile.PL",
                     "README.md",
                     "cpanfile",
                     "tidyall.ini"
                  ],
                  "allow_dirty_match" : [],
                  "changelog" : "Changes"
               },
               "Dist::Zilla::Role::Git::Repo" : {
                  "git_version" : "2.21.0 (Apple Git-122.2)",
                  "repo_root" : "."
               }
            },
            "name" : "@MAXMIND/Git::Check",
            "version" : "2.046"
         },
         {

META.json  view on Meta::CPAN

                  "allow_dirty" : [
                     "CONTRIBUTING.md",
                     "Changes",
                     "LICENSE",
                     "Makefile.PL",
                     "README.md",
                     "cpanfile",
                     "tidyall.ini"
                  ],
                  "allow_dirty_match" : [],
                  "changelog" : "Changes"
               },
               "Dist::Zilla::Role::Git::Repo" : {
                  "git_version" : "2.21.0 (Apple Git-122.2)",
                  "repo_root" : "."
               },
               "Dist::Zilla::Role::Git::StringFormatter" : {
                  "time_zone" : "local"
               }
            },
            "name" : "@MAXMIND/Commit generated files",
            "version" : "2.046"
         },
         {
            "class" : "Dist::Zilla::Plugin::Git::Tag",
            "config" : {
               "Dist::Zilla::Plugin::Git::Tag" : {
                  "branch" : null,
                  "changelog" : "Changes",
                  "signed" : 0,
                  "tag" : "v1.0002",
                  "tag_format" : "v%V",
                  "tag_message" : "v%V"
               },
               "Dist::Zilla::Role::Git::Repo" : {
                  "git_version" : "2.21.0 (Apple Git-122.2)",
                  "repo_root" : "."
               },
               "Dist::Zilla::Role::Git::StringFormatter" : {

META.json  view on Meta::CPAN

                  "commit_msg" : "Bump version after release"
               },
               "Dist::Zilla::Role::Git::DirtyFiles" : {
                  "allow_dirty" : [
                     "Changes",
                     "dist.ini"
                  ],
                  "allow_dirty_match" : [
                     "(?^:.+)"
                  ],
                  "changelog" : "Changes"
               },
               "Dist::Zilla::Role::Git::Repo" : {
                  "git_version" : "2.21.0 (Apple Git-122.2)",
                  "repo_root" : "."
               },
               "Dist::Zilla::Role::Git::StringFormatter" : {
                  "time_zone" : "local"
               }
            },
            "name" : "@MAXMIND/Commit version bump",

META.yml  view on Meta::CPAN

      name: '@MAXMIND/RunExtraTests'
      version: '0.029'
    -
      class: Dist::Zilla::Plugin::MojibakeTests
      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:

META.yml  view on Meta::CPAN

        Dist::Zilla::Role::Git::DirtyFiles:
          allow_dirty:
            - CONTRIBUTING.md
            - Changes
            - LICENSE
            - Makefile.PL
            - README.md
            - cpanfile
            - tidyall.ini
          allow_dirty_match: []
          changelog: Changes
        Dist::Zilla::Role::Git::Repo:
          git_version: '2.21.0 (Apple Git-122.2)'
          repo_root: .
      name: '@MAXMIND/Git::Check'
      version: '2.046'
    -
      class: Dist::Zilla::Plugin::Git::Commit
      config:
        Dist::Zilla::Plugin::Git::Commit:
          add_files_in: []

META.yml  view on Meta::CPAN

        Dist::Zilla::Role::Git::DirtyFiles:
          allow_dirty:
            - CONTRIBUTING.md
            - Changes
            - LICENSE
            - Makefile.PL
            - README.md
            - cpanfile
            - tidyall.ini
          allow_dirty_match: []
          changelog: Changes
        Dist::Zilla::Role::Git::Repo:
          git_version: '2.21.0 (Apple Git-122.2)'
          repo_root: .
        Dist::Zilla::Role::Git::StringFormatter:
          time_zone: local
      name: '@MAXMIND/Commit generated files'
      version: '2.046'
    -
      class: Dist::Zilla::Plugin::Git::Tag
      config:
        Dist::Zilla::Plugin::Git::Tag:
          branch: ~
          changelog: Changes
          signed: 0
          tag: v1.0002
          tag_format: v%V
          tag_message: v%V
        Dist::Zilla::Role::Git::Repo:
          git_version: '2.21.0 (Apple Git-122.2)'
          repo_root: .
        Dist::Zilla::Role::Git::StringFormatter:
          time_zone: local
      name: '@MAXMIND/Git::Tag'

META.yml  view on Meta::CPAN

      config:
        Dist::Zilla::Plugin::Git::Commit:
          add_files_in: []
          commit_msg: 'Bump version after release'
        Dist::Zilla::Role::Git::DirtyFiles:
          allow_dirty:
            - Changes
            - dist.ini
          allow_dirty_match:
            - (?^:.+)
          changelog: Changes
        Dist::Zilla::Role::Git::Repo:
          git_version: '2.21.0 (Apple Git-122.2)'
          repo_root: .
        Dist::Zilla::Role::Git::StringFormatter:
          time_zone: local
      name: '@MAXMIND/Commit version bump'
      version: '2.046'
    -
      class: Dist::Zilla::Plugin::Git::Push
      config:

README.md  view on Meta::CPAN

And then execute it locally.  Rather than running as normal your script
will instead upload itself to AWS as a Lambda function (modifying
itself so that it no longer has a dependency on AWS::Lambda::Quick) and
handle all the other steps needed to make itself web accessible.
Running the script locally subsequent times will update the code and
AWS settings.

## What This Actually Does

You probably don't care about this, but this is actually what's
going on when the script uploads itself.  This is subject to change
in later versions of this utility as better ways to do things
become available (for example AWS has a HTTP API that is currently in
beta that could make some of this easier!).

By default, unless you specify extra parameters when you import
AWS::Lambda::Quick, AWS will be configured as described below

### Create A New Role For Use With AWS::Lambda::Quick

Execution creates a new role called `perl-aws-lambda-quick` that can

README.md  view on Meta::CPAN

    `perl-aws-lambda-quick` if not passed.  If no such named rest api
    exists then one will be automatically created.

- stage\_name

    The name we stage to.  By default this is `quick` meaning that
    our live URL will be of the form:

        https://????.execute-api.????.amazonaws.com/quick/????

    By setting stage\_name to another value you can change this.

- extra\_layers

    An arrayref of extra layers (in addition to the standard prebuilt public
    Lambda layer for Perl) that will be used by this Lambda function.

    Currently AWS Lamda supports up to four extra layers (five in total
    including the prebuilt public layer for Perl.)  All layers, when
    decompressed, must be less that 250MB in size.

README.md  view on Meta::CPAN


    shell$ aws configure
    AWS Access Key ID [********************]:
    AWS Secret Access Key [********************]:
    Default region name [us-east-1]:
    Default output format [None]:

## Speeding up Code Updates

By default this module will check that everything is configured
correctly in AWS and will make changes as needed.  This requires several
API calls (and several executions of the AWS python command line
tool.)

If you've only changed the source code and want to deploy a new version
you can just do that by setting the `AWS_LAMBDA_QUICK_UPDATE_CODE_ONLY`
enviroment variable:

    shell$ AWS_LAMBDA_QUICK_UPDATE_CODE_ONLY=1 perl lambda-function.pl

In the interest of being as quick as possible, when this is environment
variable is enabled the URL for the upload is not computed and printed
out.

## Enabling debugging output

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

And then execute it locally.  Rather than running as normal your script
will instead upload itself to AWS as a Lambda function (modifying
itself so that it no longer has a dependency on AWS::Lambda::Quick) and
handle all the other steps needed to make itself web accessible.
Running the script locally subsequent times will update the code and
AWS settings.

=head2 What This Actually Does

You probably don't care about this, but this is actually what's
going on when the script uploads itself.  This is subject to change
in later versions of this utility as better ways to do things
become available (for example AWS has a HTTP API that is currently in
beta that could make some of this easier!).

By default, unless you specify extra parameters when you import
AWS::Lambda::Quick, AWS will be configured as described below

=head3 Create A New Role For Use With AWS::Lambda::Quick

Execution creates a new role called C<perl-aws-lambda-quick> that can

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

C<perl-aws-lambda-quick> if not passed.  If no such named rest api
exists then one will be automatically created.

=item stage_name

The name we stage to.  By default this is C<quick> meaning that
our live URL will be of the form:

    https://????.execute-api.????.amazonaws.com/quick/????

By setting stage_name to another value you can change this.

=item extra_layers

An arrayref of extra layers (in addition to the standard prebuilt public
Lambda layer for Perl) that will be used by this Lambda function.

Currently AWS Lamda supports up to four extra layers (five in total
including the prebuilt public layer for Perl.)  All layers, when
decompressed, must be less that 250MB in size.

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


    shell$ aws configure
    AWS Access Key ID [********************]:
    AWS Secret Access Key [********************]:
    Default region name [us-east-1]:
    Default output format [None]:

=head2 Speeding up Code Updates

By default this module will check that everything is configured
correctly in AWS and will make changes as needed.  This requires several
API calls (and several executions of the AWS python command line
tool.)

If you've only changed the source code and want to deploy a new version
you can just do that by setting the C<AWS_LAMBDA_QUICK_UPDATE_CODE_ONLY>
enviroment variable:

   shell$ AWS_LAMBDA_QUICK_UPDATE_CODE_ONLY=1 perl lambda-function.pl

In the interest of being as quick as possible, when this is environment
variable is enabled the URL for the upload is not computed and printed
out.

=head2 Enabling debugging output

xt/release/cpan-changes.t  view on Meta::CPAN

use strict;
use warnings;

# this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012

use Test::More 0.96 tests => 1;
use Test::CPAN::Changes;
subtest 'changes_ok' => sub {
    changes_file_ok('Changes');
};



( run in 0.535 second using v1.01-cache-2.11-cpan-c333fce770f )