aws-apigateway-sagemakerendpoint
| Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
| Language | Package |
|---|---|
|
|
|
|
|
|
|
|
|
Overview
This AWS Solutions Construct implements an Amazon API Gateway connected to an Amazon SageMaker endpoint pattern.
Here is a minimal deployable pattern definition:
Example
Pattern Construct Props
| Name | Type | Description |
|---|---|---|
|
apiGatewayProps? |
Optional - user provided props to override the default props for the API Gateway. |
|
|
createUsagePlan? |
boolean |
Whether to create a Usage Plan attached to the API. Must be true if apiGatewayProps.defaultMethodOptions.apiKeyRequired is true. @default - true (to match legacy behavior) |
|
apiGatewayExecutionRole? |
IAM Role used by API Gateway to invoke the SageMaker endpoint. If not
specified, a default role is created with access to |
|
|
endpointName |
|
Name of the deployed SageMaker inference endpoint. |
|
resourceName? |
|
Optional resource name where the GET method will be available. |
|
resourcePath |
|
Resource path for the GET method. The variable
defined here can be referenced in |
|
requestMappingTemplate |
|
Mapping template to convert GET
requests for the default |
|
additionalRequestTemplates |
|
Optional Request
Templates for content-types other than |
|
responseMappingTemplate? |
|
Optional mapping template to convert responses received from the SageMaker endpoint. |
|
logGroupProps? |
User provided props to override the default props for for the CloudWatchLogs LogGroup. |
Pattern Properties
| Name | Type | Description |
|---|---|---|
|
apiGateway |
Returns an instance of the API Gateway REST API created by the pattern. |
|
|
apiGatewayRole |
Returns an instance of the iam.Role created by the construct for API Gateway. |
|
|
apiGatewayCloudWatchRole? |
Returns an instance of the iam.Role created by the construct for API Gateway for CloudWatch access. |
|
|
apiGatewayLogGroup |
Returns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch. |
Sample API Usage
| Method | Request Path | Query String | SageMaker Action | Description |
|---|---|---|---|---|
|
GET |
|
|
|
Retrieves the predictions for a specific user and items. |
Default settings
Out of the box implementation of the Construct without any override will set the following defaults:
Amazon API Gateway
-
Deploy an edge-optimized API endpoint
-
Enable CloudWatch logging for API Gateway
-
Configure least privilege access IAM role for API Gateway
-
Set the default authorizationType for all API methods to IAM
-
Enable X-Ray Tracing
-
Validate request parameters before passing data to SageMaker
Architecture
Github
Go to the Github repo