Skip to content

Commit

Permalink
refactor: remove more duplicate enum values
Browse files Browse the repository at this point in the history
This is a follow-up to #19320: there are more duplicate enum values that
need to be removed, in anticipation of a jsii release that will make
these duplicate values illegal.
  • Loading branch information
rix0rrr committed Jul 4, 2022
1 parent 1061e4f commit ea002b2
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export enum CustomResourceProviderRuntime {
*
* @deprecated Use {@link NODEJS_14_X}
*/
NODEJS_12 = 'nodejs12.x',
NODEJS_12 = 'deprecated_nodejs12.x',

/**
* Node.js 14.x
Expand Down Expand Up @@ -255,7 +255,7 @@ export class CustomResourceProvider extends Construct {
MemorySize: memory.toMebibytes(),
Handler: `${ENTRYPOINT_FILENAME}.handler`,
Role: role.getAtt('Arn'),
Runtime: props.runtime,
Runtime: customResourceProviderRuntimeToString(props.runtime),
Environment: this.renderEnvironmentVariables(props.environment),
Description: props.description ?? undefined,
},
Expand Down Expand Up @@ -329,3 +329,15 @@ export class CustomResourceProvider extends Construct {
return { Variables: variables };
}
}

function customResourceProviderRuntimeToString(x: CustomResourceProviderRuntime): string {
switch (x) {
case CustomResourceProviderRuntime.NODEJS_12:
case CustomResourceProviderRuntime.NODEJS_12_X:
return 'nodejs12.x';
case CustomResourceProviderRuntime.NODEJS_14_X:
return 'nodejs14.x';
case CustomResourceProviderRuntime.NODEJS_16_X:
return 'nodejs16.x';
}
}

0 comments on commit ea002b2

Please sign in to comment.