-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 (#22865)
This is the second of three PRs to complete the implementation of RFC 431: aws/aws-cdk-rfcs#431 related to #2809 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* ---- Co-authored-by: Matt McClean <[email protected]> Co-authored-by: Long Yao <[email protected]> Co-authored-by: Drew Jetter <[email protected]> Co-authored-by: Murali Ganesh <[email protected]> Co-authored-by: Abilash Rangoju <[email protected]>
- Loading branch information
1 parent
6be4cf6
commit 0e97c15
Showing
21 changed files
with
3,817 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.