AWS Lambda Runtime API configuration steps

0

I'm trying to use AWS Lambda functions for runtime which is not supported by AWS Lambda. I have the runtime I want as a Docker Image. I will be using that Image as my base Image, Now I want to create a runtime interface client for the runtime I use to make it contact with the code that I'll be writing. But I'm finding it hard as there's no detailed documentation except for the API docs provided by AWS to make my runtime contact with the code that I'm writing. Can someone help me on which api to call first and what is the order of the api to invoke.

ramsy
已提問 2 個月前檢視次數 140 次
2 個答案
1
已接受的答案

I found the answer by myself. As mentioned the AWS doc user has to create their own version of runtime interface client if aws doesn't provide a runtime interface client.aws runtime interface doc

https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-ric

To deploy a function with custom runtime as image user has to run the runtime interface client code. This code has to invoke the APIs mentioned in the AWS doc.

https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-ric

The order is:

  1. invoke /runtime/invocation/next API
  2. get the event and context response from the above API
  3. get the request ID from the above API and forward the request to actual handler function
  4. on successfully completing the function
  5. invoke /runtime/invocation/AwsRequestId/response API with the request ID that we got from step 3

All these steps has to inside a endless loop. In the if there's chance for initialisation error or invocation error invoke following API from your code. /runtime/init/error /runtime/invocation/AwsRequestId/error

ramsy
已回答 2 個月前
profile picture
專家
已審閱 2 個月前
0

You can read the blog New for AWS Lambda – Container Image Support which walks through creation process including local testing using Lambda Runtime Interface Emulator

More details at Working with Lambda container images. Runtime interface clients (RIC) are available for several languages. Since yours is not supported, you have to create your own. RIC source codes are available from GitHub for Python and Node

AWS
專家
Mike_L
已回答 2 個月前
  • Hi @Mike thanks for your response. I read the article you shared. However it didn't answer what I was expecting. Like the second example in the article you shared shows steps to use python custom runtime using the runtime api client provided by aws "awslambdaric". The runtime I intent to use doesn't have a runtime interface client provided by AWS. I have to create my own but the problem is there is no detailed doc on implementing that. Can you share which API should I can and in which order.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南