Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A module help you automate AWS lambda function deployment.

NotificationsYou must be signed in to change notification settings

ThoughtWorksStudios/node-aws-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Built with 💛 and ☕ in San Francisco

A module helps you automate AWS lambda function deployment.All lambda configuration is managed in the codebase, includes event source mappings. So you can version control everything and automate the deployment instead of click click click in AWS console.

Inspired byhttps://medium.com/@AdamRNeary/a-gulp-workflow-for-amazon-lambda-61c2afd723b6

Gulp example:

gulpfile.js

vargulp=require('gulp');varzip=require('gulp-zip');vardel=require('del');varinstall=require('gulp-install');varrunSequence=require('run-sequence');varawsLambda=require("node-aws-lambda");gulp.task('clean',function(){returndel(['./dist','./dist.zip']);});gulp.task('js',function(){returngulp.src('index.js').pipe(gulp.dest('dist/'));});gulp.task('node-mods',function(){returngulp.src('./package.json').pipe(gulp.dest('dist/')).pipe(install({production:true}));});gulp.task('zip',function(){returngulp.src(['dist/**/*','!dist/package.json']).pipe(zip('dist.zip')).pipe(gulp.dest('./'));});gulp.task('upload',function(callback){awsLambda.deploy('./dist.zip',require("./lambda-config.js"),callback);});gulp.task('deploy',function(callback){returnrunSequence(['clean'],['js','node-mods'],['zip'],['upload'],callback);});

lambda-config.js

module.exports={accessKeyId:<accesskeyid>,  // optional  secretAccessKey:<secretaccesskey>,  // optional  sessionToken:<sessionTokenforassumingroles>,  // optional  profile:<sharedcredentialsprofilename>, // optional for loading AWS credential from custom profile  region: 'us-east-1',  handler: 'index.handler',  role:<rolearn>,  functionName:<functionname>,  timeout: 10,  memorySize: 128,  publish: true, // default: false,  runtime: 'nodejs4.3', // default: 'nodejs4.3',  vpc:{// optionalSecurityGroupIds:[<securitygroupid>, ...],    SubnetIds: [<subnetid>, ...]},  eventSource:{EventSourceArn:<eventsourcesuchaskinesisARN>,BatchSize:200,StartingPosition:"TRIM_HORIZON"}}

Proxy setup

Deployment via https proxy is supported by setting environment variable "HTTPS_PROXY". For example:

> HTTPS_PROXY="https://myproxy:8080" gulp deploy

License

(The MIT License)

Copyright (c) 2015 ThoughtWorks Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A module help you automate AWS lambda function deployment.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors12


[8]ページ先頭

©2009-2025 Movatter.jp