var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var install = require('gulp-install');
var zip = require('gulp-zip');
var AWS = require('aws-sdk');
var fs = require('fs');
var runSequence = require('run-sequence');
var tape = require('gulp-tape');
var faucet = require('faucet');
var semistandard = require('gulp-semistandard');

gulp.task('upload', function () {
  AWS.config.region = 'us-east-1';
  var lambda = new AWS.Lambda();
  var functionName = 'MetroTransit';

  lambda.getFunction({FunctionName: functionName}, function (err, data) {
    if (err) {
      var warning;
      if (err.statusCode === 404) {
        warning = 'Unable to find lambda function ' + functionName + '. ';
        warning += 'Verify the lambda function name and AWS region are correct.';
        gutil.log(warning);
      } else {
        warning = 'AWS API request failed. ';
        warning += 'Check your AWS credentials and permissions.';
        gutil.log(warning);
      }
      throw new Error(err);
    }

    var params = {
      FunctionName: functionName
    };

    fs.readFile('./dc-metro-echo.zip', function (err, data) {
      if (err) {
        var warning = 'Error creating zip.';
        gutil.log(warning);
        throw new Error(err);
      } else {
        params.ZipFile = data;
        lambda.updateFunctionCode(params, function (err, data) {
          if (err) {
            var warning = 'Package upload failed. ';
            warning += 'Check your iam:PassRole permissions.';
            gutil.log(warning);
            throw new Error(err);
          }
        });
      }
    });
  });
});

@@ -1,402 +1,118 @@
-var gulp = require('gulp');%0Avar gutil = require('gulp-util');%0Avar del = require('del');%0Avar install = require('gulp-install');%0Avar zip = require('gulp-zip');%0Avar AWS = require('aws-sdk');%0Avar fs = require('fs');%0Avar runSequence = require('run-sequence');%0Avar tape = require('gulp-tape');%0Avar faucet = require('faucet');%0Avar semistandard = require('gulp-semistandard');%0A%0Agulp.task('upload', function
+#!/usr/bin/env node%0A%0A'use strict';%0A%0Avar AWS = require('aws-sdk');%0Avar fs = require('fs');%0A%0Afunction deployToLambda
  () 
@@ -520,37 +520,39 @@
 rect.';%0A        
-gutil
+console
 .log(warning);%0A 
@@ -677,37 +677,39 @@
 ions.';%0A        
-gutil
+console
 .log(warning);%0A 
@@ -934,37 +934,39 @@
  zip.';%0A        
-gutil
+console
 .log(warning);%0A 
@@ -1258,13 +1258,15 @@
     
-gutil
+console
 .log
@@ -1357,11 +1357,28 @@
 %0A  %7D);%0A%7D
+%0A%0AdeployToLambda(
 );%0A

Clean up upload bin for npm task use