@@ -6,6 +6,12 @@ export interface LambdaRuntimeProps {
6
6
* @default false
7
7
*/
8
8
readonly supportsInlineCode ?: boolean ;
9
+
10
+ /**
11
+ * The Docker image name to be used for bundling in this runtime.
12
+ * @default - the latest docker image "amazon/aws-sam-cli-build-image-<runtime>" from https://hub.docker.com/u/amazon
13
+ */
14
+ readonly bundlingDockerImage ?: string ;
9
15
}
10
16
11
17
export enum RuntimeFamily {
@@ -113,17 +119,23 @@ export class Runtime {
113
119
/**
114
120
* The .NET Core 2.1 runtime (dotnetcore2.1)
115
121
*/
116
- public static readonly DOTNET_CORE_2_1 = new Runtime ( 'dotnetcore2.1' , RuntimeFamily . DOTNET_CORE ) ;
122
+ public static readonly DOTNET_CORE_2_1 = new Runtime ( 'dotnetcore2.1' , RuntimeFamily . DOTNET_CORE , {
123
+ bundlingDockerImage : 'lambci/lambda:build-dotnetcore2.1' ,
124
+ } ) ;
117
125
118
126
/**
119
127
* The .NET Core 3.1 runtime (dotnetcore3.1)
120
128
*/
121
- public static readonly DOTNET_CORE_3_1 = new Runtime ( 'dotnetcore3.1' , RuntimeFamily . DOTNET_CORE ) ;
129
+ public static readonly DOTNET_CORE_3_1 = new Runtime ( 'dotnetcore3.1' , RuntimeFamily . DOTNET_CORE , {
130
+ bundlingDockerImage : 'lambci/lambda:build-dotnetcore3.1' ,
131
+ } ) ;
122
132
123
133
/**
124
134
* The Go 1.x runtime (go1.x)
125
135
*/
126
- public static readonly GO_1_X = new Runtime ( 'go1.x' , RuntimeFamily . GO ) ;
136
+ public static readonly GO_1_X = new Runtime ( 'go1.x' , RuntimeFamily . GO , {
137
+ bundlingDockerImage : 'lambci/lambda:build-go1.x' ,
138
+ } ) ;
127
139
128
140
/**
129
141
* The Ruby 2.5 runtime (ruby2.5)
@@ -158,17 +170,15 @@ export class Runtime {
158
170
159
171
/**
160
172
* The bundling Docker image for this runtime.
161
- * Points to the AWS SAM build image for this runtime.
162
- *
163
- * @see https://github.com/awslabs/aws-sam-cli
164
173
*/
165
174
public readonly bundlingDockerImage : BundlingDockerImage ;
166
175
167
176
constructor ( name : string , family ?: RuntimeFamily , props : LambdaRuntimeProps = { } ) {
168
177
this . name = name ;
169
178
this . supportsInlineCode = ! ! props . supportsInlineCode ;
170
179
this . family = family ;
171
- this . bundlingDockerImage = BundlingDockerImage . fromRegistry ( `amazon/aws-sam-cli-build-image-${ name } ` ) ;
180
+ const imageName = props . bundlingDockerImage ?? `amazon/aws-sam-cli-build-image-${ name } ` ;
181
+ this . bundlingDockerImage = BundlingDockerImage . fromRegistry ( imageName ) ;
172
182
173
183
Runtime . ALL . push ( this ) ;
174
184
}
0 commit comments