Skip to content

Commit 07780a9

Browse files
authored
Fill default VpcConfig to prevent errors (#183)
1 parent bce4dd0 commit 07780a9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ Lambda.prototype._params = function (program, buffer) {
122122
MemorySize: program.memorySize,
123123
Timeout: program.timeout,
124124
Publish: program.publish,
125-
VpcConfig: {},
125+
VpcConfig: {
126+
SubnetIds: [],
127+
SecurityGroupIds: []
128+
},
126129
Environment: {
127130
Variables: {}
128131
}

test/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ describe('node-lambda', function () {
7171

7272
it('does not append VpcConfig when params are not set', function() {
7373
var params = lambda._params(program);
74-
assert.equal(Object.keys(params.VpcConfig).length, 0);
74+
assert.equal(Object.keys(params.VpcConfig.SubnetIds).length, 0);
75+
assert.equal(Object.keys(params.VpcConfig.SecurityGroupIds).length, 0);
7576
});
7677

7778
describe('configFile', function () {

0 commit comments

Comments
 (0)