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
preguntada hace 2 meses139 visualizaciones
2 Respuestas
1
Respuesta aceptada

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
respondido hace 2 meses
profile picture
EXPERTO
revisado hace 2 meses
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
EXPERTO
Mike_L
respondido hace 2 meses
  • 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.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas