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달 전138회 조회
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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠