forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sagemaker): add EndpointConfig L2 construct
This is the second of three PRs to complete the implementation of RFC 431: aws/aws-cdk-rfcs#431 related to aws#2809 Co-authored-by: Matt McClean <mmcclean@amazon.com> Co-authored-by: Long Yao <yl1984108@gmail.com> Co-authored-by: Drew Jetter <60628154+jetterdj@users.noreply.github.com> Co-authored-by: Murali Ganesh <59461079+foxpro24@users.noreply.github.com> Co-authored-by: Abilash Rangoju <988529+rangoju@users.noreply.github.com>
- Loading branch information
1 parent
6fe034c
commit 8c8a4f9
Showing
21 changed files
with
3,811 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import * as cdk from '@aws-cdk/core'; | ||
|
||
/** | ||
* Supported Elastic Inference (EI) instance types for SageMaker instance-based production variants. | ||
* EI instances provide on-demand GPU computing for inference. | ||
*/ | ||
export class AcceleratorType { | ||
/** | ||
* ml.eia1.large | ||
*/ | ||
public static readonly EIA1_LARGE = AcceleratorType.of('ml.eia1.large'); | ||
|
||
/** | ||
* ml.eia1.medium | ||
*/ | ||
public static readonly EIA1_MEDIUM = AcceleratorType.of('ml.eia1.medium'); | ||
|
||
/** | ||
* ml.eia1.xlarge | ||
*/ | ||
public static readonly EIA1_XLARGE = AcceleratorType.of('ml.eia1.xlarge'); | ||
|
||
/** | ||
* ml.eia2.large | ||
*/ | ||
public static readonly EIA2_LARGE = AcceleratorType.of('ml.eia2.large'); | ||
|
||
/** | ||
* ml.eia2.medium | ||
*/ | ||
public static readonly EIA2_MEDIUM = AcceleratorType.of('ml.eia2.medium'); | ||
|
||
/** | ||
* ml.eia2.xlarge | ||
*/ | ||
public static readonly EIA2_XLARGE = AcceleratorType.of('ml.eia2.xlarge'); | ||
|
||
/** | ||
* Builds an AcceleratorType from a given string or token (such as a CfnParameter). | ||
* @param acceleratorType An accelerator type as string | ||
* @returns A strongly typed AcceleratorType | ||
*/ | ||
public static of(acceleratorType: string): AcceleratorType { | ||
return new AcceleratorType(acceleratorType); | ||
} | ||
|
||
private readonly acceleratorTypeIdentifier: string; | ||
|
||
constructor(acceleratorType: string) { | ||
if (cdk.Token.isUnresolved(acceleratorType) || acceleratorType.startsWith('ml.')) { | ||
this.acceleratorTypeIdentifier = acceleratorType; | ||
} else { | ||
throw new Error(`instance type must start with 'ml.'; (got ${acceleratorType})`); | ||
} | ||
} | ||
|
||
/** | ||
* Return the accelerator type as a string | ||
* @returns The accelerator type as a string | ||
*/ | ||
public toString(): string { | ||
return this.acceleratorTypeIdentifier; | ||
} | ||
} |
Oops, something went wrong.