AWS-Lambda-Quick
view release on metacpan or search on metacpan
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.
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
To gain a little more insight into what is going on you can set
the `AWS_LAMBDA_QUICK_DEBUG` environment variable to enabled
debugging to STDERR:
shell$ AWS_LAMBDA_QUICK_DEBUG=1 perl lambda-function.pl
updating function code
lib/AWS/Lambda/Quick.pm view on Meta::CPAN
# where's the source code of the script calling us?
my ( undef, $file, undef ) = caller;
# process the whole thing
my $proc = AWS::Lambda::Quick::Processor->new(
src_filename => $file,
@_,
);
my $url = $proc->process;
print "$url\n" or die "problem with fh: $!";
# and exit before we run the remainder of the script
# (since that's meant to be run on AWS Lambda, and we're just
# uploading at this time!)
exit;
}
1;
__END__
lib/AWS/Lambda/Quick.pm view on Meta::CPAN
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
To gain a little more insight into what is going on you can set
the C<AWS_LAMBDA_QUICK_DEBUG> environment variable to enabled
debugging to STDERR:
shell$ AWS_LAMBDA_QUICK_DEBUG=1 perl lambda-function.pl
updating function code
lib/AWS/Lambda/Quick/Upload.pm view on Meta::CPAN
}
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 ();
}
sub just_update_function_code {
my $self = shift;
$self->aws_do(
'lambda',
'update-function-code',
t/00-report-prereqs.t view on Meta::CPAN
if ( @reports ) {
push @full_reports, "=== $title ===\n\n";
my $ml = _max( map { length $_->[0] } @reports );
my $wl = _max( map { length $_->[1] } @reports );
my $hl = _max( map { length $_->[2] } @reports );
if ($type eq 'modules') {
splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
}
else {
splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
}
push @full_reports, "\n";
}
}
}
if ( @full_reports ) {
diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
}
( run in 0.780 second using v1.01-cache-2.11-cpan-de7293f3b23 )