Skip to content

Commit 6c6ec95

Browse files
author
awstools
committed
feat(client-emr-serverless): Adds support for customized images. You can now provide runtime images when creating or updating EMR Serverless Applications.
1 parent d7ca5a7 commit 6c6ec95

File tree

4 files changed

+257
-45
lines changed

4 files changed

+257
-45
lines changed

clients/client-emr-serverless/src/endpoint/EndpointParameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
2424
};
2525

2626
export interface EndpointParameters extends __EndpointParameters {
27-
Region?: string;
27+
Region: string;
2828
UseDualStack?: boolean;
2929
UseFIPS?: boolean;
3030
Endpoint?: string;

clients/client-emr-serverless/src/endpoint/ruleset.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
66
or see "smithy.rules#endpointRuleSet"
77
in codegen/sdk-codegen/aws-models/emr-serverless.json */
88

9-
const p="required",
10-
q="fn",
11-
r="argv",
12-
s="ref";
13-
const a="PartitionResult",
14-
b="tree",
15-
c="error",
16-
d="endpoint",
17-
e={[p]:false,"type":"String"},
18-
f={[p]:true,"default":false,"type":"Boolean"},
19-
g={[s]:"Endpoint"},
20-
h={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
21-
i={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
22-
j={},
23-
k={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsFIPS"]}]},
24-
l={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsDualStack"]}]},
25-
m=[g],
26-
n=[h],
27-
o=[i];
28-
const _data={version:"1.0",parameters:{Region:e,UseDualStack:f,UseFIPS:f,Endpoint:e},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:a}],type:b,rules:[{conditions:[{[q]:"isSet",[r]:m},{[q]:"parseURL",[r]:m,assign:"url"}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:g,properties:j,headers:j},type:d}]}]},{conditions:[h,i],type:b,rules:[{conditions:[k,l],type:b,rules:[{endpoint:{url:"https://emr-serverless-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[k],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://emr-serverless-fips.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[l],type:b,rules:[{endpoint:{url:"https://emr-serverless.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://emr-serverless.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]};
9+
const r="fn",
10+
s="argv",
11+
t="ref";
12+
const a=true,
13+
b=false,
14+
c="String",
15+
d="PartitionResult",
16+
e="tree",
17+
f="error",
18+
g="endpoint",
19+
h={"required":true,"default":false,"type":"Boolean"},
20+
i={[t]:"Endpoint"},
21+
j={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
22+
k={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
23+
l={},
24+
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:d},"supportsFIPS"]}]},
25+
n={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:d},"supportsDualStack"]}]},
26+
o=[i],
27+
p=[j],
28+
q=[k];
29+
const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:h,UseFIPS:h,Endpoint:{required:b,type:c}},rules:[{conditions:[{[r]:"aws.partition",[s]:[{[t]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[r]:"isSet",[s]:o},{[r]:"parseURL",[s]:o,assign:"url"}],type:e,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:i,properties:l,headers:l},type:g}]}]},{conditions:[j,k],type:e,rules:[{conditions:[m,n],type:e,rules:[{endpoint:{url:"https://emr-serverless-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:p,type:e,rules:[{conditions:[m],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://emr-serverless-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:q,type:e,rules:[{conditions:[n],type:e,rules:[{endpoint:{url:"https://emr-serverless.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{endpoint:{url:"https://emr-serverless.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]};
2930
export const ruleSet: RuleSetObject = _data;

clients/client-emr-serverless/src/models/models_0.ts

Lines changed: 137 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ export interface AutoStopConfig {
3737
idleTimeoutMinutes?: number;
3838
}
3939

40+
/**
41+
* <p>The applied image configuration.</p>
42+
*/
43+
export interface ImageConfiguration {
44+
/**
45+
* <p>The image URI.</p>
46+
*/
47+
imageUri: string | undefined;
48+
49+
/**
50+
* <p>The SHA256 digest of the image URI. This indicates which specific image
51+
* the application is configured for. The image digest doesn't exist until an application has started.</p>
52+
*/
53+
resolvedImageDigest?: string;
54+
}
55+
4056
/**
4157
* <p>The cumulative configuration requirements for every worker instance of the worker
4258
* type.</p>
@@ -119,6 +135,16 @@ export enum ApplicationState {
119135
TERMINATED = "TERMINATED",
120136
}
121137

138+
/**
139+
* <p>The specifications for a worker type.</p>
140+
*/
141+
export interface WorkerTypeSpecification {
142+
/**
143+
* <p>The image configuration for a worker type.</p>
144+
*/
145+
imageConfiguration?: ImageConfiguration;
146+
}
147+
122148
/**
123149
* <p>Information about an application. EMR Serverless uses applications to run jobs.</p>
124150
*/
@@ -139,7 +165,7 @@ export interface Application {
139165
arn: string | undefined;
140166

141167
/**
142-
* <p>The EMR release version associated with the application.</p>
168+
* <p>The EMR release associated with the application.</p>
143169
*/
144170
releaseLabel: string | undefined;
145171

@@ -205,6 +231,16 @@ export interface Application {
205231
* <p>The CPU architecture of an application.</p>
206232
*/
207233
architecture?: Architecture | string;
234+
235+
/**
236+
* <p>The image configuration applied to all worker types.</p>
237+
*/
238+
imageConfiguration?: ImageConfiguration;
239+
240+
/**
241+
* <p>The specification applied to each worker type.</p>
242+
*/
243+
workerTypeSpecifications?: Record<string, WorkerTypeSpecification>;
208244
}
209245

210246
/**
@@ -227,7 +263,7 @@ export interface ApplicationSummary {
227263
arn: string | undefined;
228264

229265
/**
230-
* <p>The EMR release version associated with the application.</p>
266+
* <p>The EMR release associated with the application.</p>
231267
*/
232268
releaseLabel: string | undefined;
233269

@@ -282,14 +318,35 @@ export class ConflictException extends __BaseException {
282318
}
283319
}
284320

321+
/**
322+
* <p>The image configuration.</p>
323+
*/
324+
export interface ImageConfigurationInput {
325+
/**
326+
* <p>The URI of an image in the Amazon ECR registry. This field is required when you create a new
327+
* application. If you leave this field blank in an update, Amazon EMR will remove the image configuration.</p>
328+
*/
329+
imageUri?: string;
330+
}
331+
332+
/**
333+
* <p>The specifications for a worker type.</p>
334+
*/
335+
export interface WorkerTypeSpecificationInput {
336+
/**
337+
* <p>The image configuration for a worker type.</p>
338+
*/
339+
imageConfiguration?: ImageConfigurationInput;
340+
}
341+
285342
export interface CreateApplicationRequest {
286343
/**
287344
* <p>The name of the application.</p>
288345
*/
289346
name?: string;
290347

291348
/**
292-
* <p>The EMR release version associated with the application.</p>
349+
* <p>The EMR release associated with the application.</p>
293350
*/
294351
releaseLabel: string | undefined;
295352

@@ -341,6 +398,20 @@ export interface CreateApplicationRequest {
341398
* <p>The CPU architecture of an application.</p>
342399
*/
343400
architecture?: Architecture | string;
401+
402+
/**
403+
* <p>The image configuration for all worker types. You can either set this parameter or <code>imageConfiguration</code>
404+
* for each worker type in <code>workerTypeSpecifications</code>.</p>
405+
*/
406+
imageConfiguration?: ImageConfigurationInput;
407+
408+
/**
409+
* <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid
410+
* worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for
411+
* Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set
412+
* image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
413+
*/
414+
workerTypeSpecifications?: Record<string, WorkerTypeSpecificationInput>;
344415
}
345416

346417
export interface CreateApplicationResponse {
@@ -379,6 +450,25 @@ export class InternalServerException extends __BaseException {
379450
}
380451
}
381452

453+
/**
454+
* <p>The specified resource was not found.</p>
455+
*/
456+
export class ResourceNotFoundException extends __BaseException {
457+
readonly name: "ResourceNotFoundException" = "ResourceNotFoundException";
458+
readonly $fault: "client" = "client";
459+
/**
460+
* @internal
461+
*/
462+
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>) {
463+
super({
464+
name: "ResourceNotFoundException",
465+
$fault: "client",
466+
...opts,
467+
});
468+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
469+
}
470+
}
471+
382472
/**
383473
* <p>The input fails to satisfy the constraints specified by an AWS service.</p>
384474
*/
@@ -407,25 +497,6 @@ export interface DeleteApplicationRequest {
407497

408498
export interface DeleteApplicationResponse {}
409499

410-
/**
411-
* <p>The specified resource was not found.</p>
412-
*/
413-
export class ResourceNotFoundException extends __BaseException {
414-
readonly name: "ResourceNotFoundException" = "ResourceNotFoundException";
415-
readonly $fault: "client" = "client";
416-
/**
417-
* @internal
418-
*/
419-
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>) {
420-
super({
421-
name: "ResourceNotFoundException",
422-
$fault: "client",
423-
...opts,
424-
});
425-
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
426-
}
427-
}
428-
429500
export interface GetApplicationRequest {
430501
/**
431502
* <p>The ID of the application that will be described.</p>
@@ -552,6 +623,20 @@ export interface UpdateApplicationRequest {
552623
* <p>The CPU architecture of an application.</p>
553624
*/
554625
architecture?: Architecture | string;
626+
627+
/**
628+
* <p>The image configuration to be used for all worker types. You can either set this parameter or <code>imageConfiguration</code>
629+
* for each worker type in <code>WorkerTypeSpecificationInput</code>.</p>
630+
*/
631+
imageConfiguration?: ImageConfigurationInput;
632+
633+
/**
634+
* <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid
635+
* worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for
636+
* Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set
637+
* image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
638+
*/
639+
workerTypeSpecifications?: Record<string, WorkerTypeSpecificationInput>;
555640
}
556641

557642
export interface UpdateApplicationResponse {
@@ -869,7 +954,7 @@ export interface JobRunSummary {
869954
stateDetails: string | undefined;
870955

871956
/**
872-
* <p>The EMR release version associated with the application your job is running on.</p>
957+
* <p>The EMR release associated with the application your job is running on.</p>
873958
*/
874959
releaseLabel: string | undefined;
875960

@@ -1051,7 +1136,7 @@ export interface JobRun {
10511136
stateDetails: string | undefined;
10521137

10531138
/**
1054-
* <p>The EMR release version associated with the application your job is running on.</p>
1139+
* <p>The EMR release associated with the application your job is running on.</p>
10551140
*/
10561141
releaseLabel: string | undefined;
10571142

@@ -1154,6 +1239,13 @@ export const AutoStopConfigFilterSensitiveLog = (obj: AutoStopConfig): any => ({
11541239
...obj,
11551240
});
11561241

1242+
/**
1243+
* @internal
1244+
*/
1245+
export const ImageConfigurationFilterSensitiveLog = (obj: ImageConfiguration): any => ({
1246+
...obj,
1247+
});
1248+
11571249
/**
11581250
* @internal
11591251
*/
@@ -1182,6 +1274,13 @@ export const NetworkConfigurationFilterSensitiveLog = (obj: NetworkConfiguration
11821274
...obj,
11831275
});
11841276

1277+
/**
1278+
* @internal
1279+
*/
1280+
export const WorkerTypeSpecificationFilterSensitiveLog = (obj: WorkerTypeSpecification): any => ({
1281+
...obj,
1282+
});
1283+
11851284
/**
11861285
* @internal
11871286
*/
@@ -1196,6 +1295,20 @@ export const ApplicationSummaryFilterSensitiveLog = (obj: ApplicationSummary): a
11961295
...obj,
11971296
});
11981297

1298+
/**
1299+
* @internal
1300+
*/
1301+
export const ImageConfigurationInputFilterSensitiveLog = (obj: ImageConfigurationInput): any => ({
1302+
...obj,
1303+
});
1304+
1305+
/**
1306+
* @internal
1307+
*/
1308+
export const WorkerTypeSpecificationInputFilterSensitiveLog = (obj: WorkerTypeSpecificationInput): any => ({
1309+
...obj,
1310+
});
1311+
11991312
/**
12001313
* @internal
12011314
*/

0 commit comments

Comments
 (0)