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
asked 2 months ago127 views
2 Answers
1
Accepted Answer

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
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
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
EXPERT
Mike_L
answered 2 months ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions