Skip to content

Commit

Permalink
fix(lambda): Add 'provided' runtime (#1764)
Browse files Browse the repository at this point in the history
Provided runtime can be used for custom runtimes.

Fixes #1761.
  • Loading branch information
rix0rrr committed Feb 14, 2019
1 parent afdd173 commit 73d5bef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-lambda/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export enum RuntimeFamily {
Python,
DotNetCore,
Go,
Ruby
Ruby,
Other
}

/**
Expand All @@ -38,6 +39,7 @@ export class Runtime {
public static readonly DotNetCore21 = new Runtime('dotnetcore2.1', RuntimeFamily.DotNetCore);
public static readonly Go1x = new Runtime('go1.x', RuntimeFamily.Go);
public static readonly Ruby25 = new Runtime('ruby2.5', RuntimeFamily.Ruby, { supportsInlineCode: true });
public static readonly Provided = new Runtime('provided', RuntimeFamily.Other);

/**
* The name of this runtime, as expected by the Lambda resource.
Expand Down
9 changes: 9 additions & 0 deletions packages/@aws-cdk/aws-lambda/test/test.lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,15 @@ export = {

// THEN
test.deepEqual(bindCount, 2);
test.done();
},

'Provided Runtime returns the right values'(test: Test) {
const rt = lambda.Runtime.Provided;

test.equal(rt.name, 'provided');
test.equal(rt.supportsInlineCode, false);

test.done();
}
};
Expand Down

0 comments on commit 73d5bef

Please sign in to comment.