Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 7324b34

Browse files
author
Parth Shah
committed
initial commit
1 parent c6728c1 commit 7324b34

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@ gulp.task('deploy', function(callback) {
2929
lambda-config.js :
3030
````js
3131
module.exports = {
32-
accessKeyId: <access key id>, // optional
33-
secretAccessKey: <secret access key>, // optional
34-
profile: <shared credentials profile name>, // optional for loading AWS credentials from custom profile
32+
accessKeyId: process.env.AWS_ACCESS_KEY,
33+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
3534
region: 'us-east-1',
3635
handler: 'index.handler',
37-
role: <role arn>,
36+
role: process.env.AWS_LABMDA_ARN,
3837
functionName: <function name>,
3938
timeout: 10,
4039
memorySize: 128,
41-
eventSource: {
40+
eventSource: { // optional
4241
EventSourceArn: <event source such as kinesis ARN>,
4342
BatchSize: 200,
4443
StartingPosition: "TRIM_HORIZON"

index.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
21
var gulp = require('gulp'),
3-
zip = require('gulp-zip'),
4-
del = require('del'),
5-
install = require('gulp-install'),
6-
awsLambda = require('node-aws-lambda'),
7-
path = require('path');
2+
zip = require('gulp-zip'),
3+
del = require('del'),
4+
install = require('gulp-install'),
5+
awsLambda = require('node-aws-lambda'),
6+
envify = require('gulp-envify'),
7+
path = require('path');
88

99
module.exports = function(gulp) {
1010

@@ -13,14 +13,15 @@ module.exports = function(gulp) {
1313
});
1414

1515
gulp.task('js', function() {
16-
return gulp.src('index.js')
16+
return gulp.src(['src/**/*', '!src/**/*.spec.js'])
17+
.pipe(envify(process.env))
1718
.pipe(gulp.dest('dist/'));
1819
});
1920

2021
gulp.task('node-mods', function() {
2122
return gulp.src('./package.json')
2223
.pipe(gulp.dest('dist/'))
23-
.pipe(install({production: true}));
24+
.pipe(install({ production: true }));
2425
});
2526

2627
gulp.task('zip', function() {
@@ -30,7 +31,7 @@ module.exports = function(gulp) {
3031
});
3132

3233
gulp.task('upload', function(callback) {
33-
awsLambda.deploy('./dist.zip', require( path.join(process.cwd(), "lambda-config.js") ), callback);
34+
awsLambda.deploy('./dist.zip', require(path.join(process.cwd(), "lambda-config.js")), callback);
3435
});
3536

3637
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/neyric/aws-lambda-gulp-tasks.git"
8+
"url": "https://github.com/appirio-tech/tc-aws-lambda-gulp-tasks.git"
99
},
1010
"keywords": [
1111
"aws",

0 commit comments

Comments
 (0)