- Newest
- Most votes
- Most comments
Yes, you can invoke a SageMaker asynchronous model endpoint directly from an API Gateway without using a Lambda function. AWS provides a construct called aws-apigateway-sagemakerendpoint
that allows you to connect an Amazon API Gateway directly to a SageMaker endpoint.
This construct sets up the necessary components to enable direct communication between API Gateway and your SageMaker endpoint. It includes several helpful features:
- Deployment of an edge-optimized API endpoint
- Enabling of CloudWatch logging for API Gateway
- Configuration of least privilege access IAM role for API Gateway
- Setting the default authorization type for all API methods to IAM
- Enabling X-Ray tracing for better monitoring
- Validation of request parameters before passing data to SageMaker
By using this construct, you can create a serverless architecture that allows clients to interact with your SageMaker model through API Gateway without the need for an intermediary Lambda function. This can potentially reduce latency and simplify your overall architecture.
However, it's important to note that this setup is primarily designed for synchronous inference. If you specifically need asynchronous inference, you might need to consider additional architectural components or custom implementations to handle the asynchronous nature of the requests and responses.
Sources
aws-apigateway-sagemakerendpoint - AWS Solutions Constructs
Relevant content
- AWS OFFICIALUpdated a month ago