Skip to content

Commit

Permalink
feat(client-emr-serverless): Adds support for customized images. You …
Browse files Browse the repository at this point in the history
…can now provide runtime images when creating or updating EMR Serverless Applications.
  • Loading branch information
awstools committed Jan 5, 2023
1 parent d7ca5a7 commit 6c6ec95
Show file tree
Hide file tree
Showing 4 changed files with 257 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
};

export interface EndpointParameters extends __EndpointParameters {
Region?: string;
Region: string;
UseDualStack?: boolean;
UseFIPS?: boolean;
Endpoint?: string;
Expand Down
41 changes: 21 additions & 20 deletions clients/client-emr-serverless/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/emr-serverless.json */

const p="required",
q="fn",
r="argv",
s="ref";
const a="PartitionResult",
b="tree",
c="error",
d="endpoint",
e={[p]:false,"type":"String"},
f={[p]:true,"default":false,"type":"Boolean"},
g={[s]:"Endpoint"},
h={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
i={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
j={},
k={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsFIPS"]}]},
l={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsDualStack"]}]},
m=[g],
n=[h],
o=[i];
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}]}]};
const r="fn",
s="argv",
t="ref";
const a=true,
b=false,
c="String",
d="PartitionResult",
e="tree",
f="error",
g="endpoint",
h={"required":true,"default":false,"type":"Boolean"},
i={[t]:"Endpoint"},
j={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
k={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
l={},
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:d},"supportsFIPS"]}]},
n={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:d},"supportsDualStack"]}]},
o=[i],
p=[j],
q=[k];
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}]}]};
export const ruleSet: RuleSetObject = _data;
161 changes: 137 additions & 24 deletions clients/client-emr-serverless/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ export interface AutoStopConfig {
idleTimeoutMinutes?: number;
}

/**
* <p>The applied image configuration.</p>
*/
export interface ImageConfiguration {
/**
* <p>The image URI.</p>
*/
imageUri: string | undefined;

/**
* <p>The SHA256 digest of the image URI. This indicates which specific image
* the application is configured for. The image digest doesn't exist until an application has started.</p>
*/
resolvedImageDigest?: string;
}

/**
* <p>The cumulative configuration requirements for every worker instance of the worker
* type.</p>
Expand Down Expand Up @@ -119,6 +135,16 @@ export enum ApplicationState {
TERMINATED = "TERMINATED",
}

/**
* <p>The specifications for a worker type.</p>
*/
export interface WorkerTypeSpecification {
/**
* <p>The image configuration for a worker type.</p>
*/
imageConfiguration?: ImageConfiguration;
}

/**
* <p>Information about an application. EMR Serverless uses applications to run jobs.</p>
*/
Expand All @@ -139,7 +165,7 @@ export interface Application {
arn: string | undefined;

/**
* <p>The EMR release version associated with the application.</p>
* <p>The EMR release associated with the application.</p>
*/
releaseLabel: string | undefined;

Expand Down Expand Up @@ -205,6 +231,16 @@ export interface Application {
* <p>The CPU architecture of an application.</p>
*/
architecture?: Architecture | string;

/**
* <p>The image configuration applied to all worker types.</p>
*/
imageConfiguration?: ImageConfiguration;

/**
* <p>The specification applied to each worker type.</p>
*/
workerTypeSpecifications?: Record<string, WorkerTypeSpecification>;
}

/**
Expand All @@ -227,7 +263,7 @@ export interface ApplicationSummary {
arn: string | undefined;

/**
* <p>The EMR release version associated with the application.</p>
* <p>The EMR release associated with the application.</p>
*/
releaseLabel: string | undefined;

Expand Down Expand Up @@ -282,14 +318,35 @@ export class ConflictException extends __BaseException {
}
}

/**
* <p>The image configuration.</p>
*/
export interface ImageConfigurationInput {
/**
* <p>The URI of an image in the Amazon ECR registry. This field is required when you create a new
* application. If you leave this field blank in an update, Amazon EMR will remove the image configuration.</p>
*/
imageUri?: string;
}

/**
* <p>The specifications for a worker type.</p>
*/
export interface WorkerTypeSpecificationInput {
/**
* <p>The image configuration for a worker type.</p>
*/
imageConfiguration?: ImageConfigurationInput;
}

export interface CreateApplicationRequest {
/**
* <p>The name of the application.</p>
*/
name?: string;

/**
* <p>The EMR release version associated with the application.</p>
* <p>The EMR release associated with the application.</p>
*/
releaseLabel: string | undefined;

Expand Down Expand Up @@ -341,6 +398,20 @@ export interface CreateApplicationRequest {
* <p>The CPU architecture of an application.</p>
*/
architecture?: Architecture | string;

/**
* <p>The image configuration for all worker types. You can either set this parameter or <code>imageConfiguration</code>
* for each worker type in <code>workerTypeSpecifications</code>.</p>
*/
imageConfiguration?: ImageConfigurationInput;

/**
* <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid
* worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for
* Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set
* image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
*/
workerTypeSpecifications?: Record<string, WorkerTypeSpecificationInput>;
}

export interface CreateApplicationResponse {
Expand Down Expand Up @@ -379,6 +450,25 @@ export class InternalServerException extends __BaseException {
}
}

/**
* <p>The specified resource was not found.</p>
*/
export class ResourceNotFoundException extends __BaseException {
readonly name: "ResourceNotFoundException" = "ResourceNotFoundException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>) {
super({
name: "ResourceNotFoundException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
}
}

/**
* <p>The input fails to satisfy the constraints specified by an AWS service.</p>
*/
Expand Down Expand Up @@ -407,25 +497,6 @@ export interface DeleteApplicationRequest {

export interface DeleteApplicationResponse {}

/**
* <p>The specified resource was not found.</p>
*/
export class ResourceNotFoundException extends __BaseException {
readonly name: "ResourceNotFoundException" = "ResourceNotFoundException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>) {
super({
name: "ResourceNotFoundException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
}
}

export interface GetApplicationRequest {
/**
* <p>The ID of the application that will be described.</p>
Expand Down Expand Up @@ -552,6 +623,20 @@ export interface UpdateApplicationRequest {
* <p>The CPU architecture of an application.</p>
*/
architecture?: Architecture | string;

/**
* <p>The image configuration to be used for all worker types. You can either set this parameter or <code>imageConfiguration</code>
* for each worker type in <code>WorkerTypeSpecificationInput</code>.</p>
*/
imageConfiguration?: ImageConfigurationInput;

/**
* <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid
* worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for
* Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set
* image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
*/
workerTypeSpecifications?: Record<string, WorkerTypeSpecificationInput>;
}

export interface UpdateApplicationResponse {
Expand Down Expand Up @@ -869,7 +954,7 @@ export interface JobRunSummary {
stateDetails: string | undefined;

/**
* <p>The EMR release version associated with the application your job is running on.</p>
* <p>The EMR release associated with the application your job is running on.</p>
*/
releaseLabel: string | undefined;

Expand Down Expand Up @@ -1051,7 +1136,7 @@ export interface JobRun {
stateDetails: string | undefined;

/**
* <p>The EMR release version associated with the application your job is running on.</p>
* <p>The EMR release associated with the application your job is running on.</p>
*/
releaseLabel: string | undefined;

Expand Down Expand Up @@ -1154,6 +1239,13 @@ export const AutoStopConfigFilterSensitiveLog = (obj: AutoStopConfig): any => ({
...obj,
});

/**
* @internal
*/
export const ImageConfigurationFilterSensitiveLog = (obj: ImageConfiguration): any => ({
...obj,
});

/**
* @internal
*/
Expand Down Expand Up @@ -1182,6 +1274,13 @@ export const NetworkConfigurationFilterSensitiveLog = (obj: NetworkConfiguration
...obj,
});

/**
* @internal
*/
export const WorkerTypeSpecificationFilterSensitiveLog = (obj: WorkerTypeSpecification): any => ({
...obj,
});

/**
* @internal
*/
Expand All @@ -1196,6 +1295,20 @@ export const ApplicationSummaryFilterSensitiveLog = (obj: ApplicationSummary): a
...obj,
});

/**
* @internal
*/
export const ImageConfigurationInputFilterSensitiveLog = (obj: ImageConfigurationInput): any => ({
...obj,
});

/**
* @internal
*/
export const WorkerTypeSpecificationInputFilterSensitiveLog = (obj: WorkerTypeSpecificationInput): any => ({
...obj,
});

/**
* @internal
*/
Expand Down
Loading

0 comments on commit 6c6ec95

Please sign in to comment.