Skip to content

Commit 73d5bef

Browse files
authored
fix(lambda): Add 'provided' runtime (#1764)
Provided runtime can be used for custom runtimes. Fixes #1761.
1 parent afdd173 commit 73d5bef

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/@aws-cdk/aws-lambda/lib/runtime.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export enum RuntimeFamily {
1212
Python,
1313
DotNetCore,
1414
Go,
15-
Ruby
15+
Ruby,
16+
Other
1617
}
1718

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

4244
/**
4345
* The name of this runtime, as expected by the Lambda resource.

packages/@aws-cdk/aws-lambda/test/test.lambda.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,15 @@ export = {
12861286

12871287
// THEN
12881288
test.deepEqual(bindCount, 2);
1289+
test.done();
1290+
},
1291+
1292+
'Provided Runtime returns the right values'(test: Test) {
1293+
const rt = lambda.Runtime.Provided;
1294+
1295+
test.equal(rt.name, 'provided');
1296+
test.equal(rt.supportsInlineCode, false);
1297+
12891298
test.done();
12901299
}
12911300
};

0 commit comments

Comments
 (0)