The following notebook and lambda function implement the following architecture.
The SageMaker inference pipeline is deployed as a SageMaker endpoint. A Lambda function is generated that is tied to an external endpoint. When a realtime HTTP call is made the lambda function process the call, calls the SageMaker endpoint and returns the data.
A separate process is assumed to process actuals as they are received in the system.
The below file is a Jupyter notebook file that should be uploaded the the Sagemaker Notebook Instance.
The Lambda function Python is below:
Both the Jupyter Notebook and the Python file should be uploaded to a Notebook Instance.