Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const AWS_DLQ_TARGET_ARN = (function () {
}
return undefined
})()
const PROXY = process.env.PROXY || process.env.http_proxy || ''

program
.command('deploy')
Expand Down Expand Up @@ -123,6 +124,7 @@ program
.option('-D, --prebuiltDirectory [' + PREBUILT_DIRECTORY + ']', 'Prebuilt directory', PREBUILT_DIRECTORY)
.option('-T, --deployTimeout [' + DEPLOY_TIMEOUT + ']', 'Deploy Timeout', DEPLOY_TIMEOUT)
.option('-z, --deployZipfile [' + DEPLOY_ZIPFILE + ']', 'Deploy zipfile', DEPLOY_ZIPFILE)
.option('-y, --proxy [' + PROXY + ']', 'Proxy server', PROXY)
.action(function (prg) {
lambda.deploy(prg)
})
Expand Down
5 changes: 5 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const packageJson = require(path.join(__dirname, '..', 'package.json'))
const minimatch = require('minimatch')
const zip = new (require('node-zip'))()
const dotenv = require('dotenv')
const proxy = require('proxy-agent')
const ScheduleEvents = require(path.join(__dirname, 'schedule_events'))

const maxBufferSize = 50 * 1024 * 1024
Expand Down Expand Up @@ -792,6 +793,10 @@ Lambda.prototype._deployToRegion = function (program, params, region) {
aws.config.httpOptions.timeout = parseInt(program.deployTimeout)
}

if (program.proxy) {
aws.config.httpOptions.agent = proxy(program.proxy)
}

aws.config.update(awsSecurity)

const lambda = new aws.Lambda({ apiVersion: '2015-03-31' })
Expand Down
Loading