Lambda Container Runtime - At Invocation, pass in overrides

0

I have an idea for a service that I want to deploy, and it will be reliant on being able to pass in a COMMAND override at invocation. I can manually add what I need in the management console (shown below), but how can I pass in this information when I invoke the lambda, which in my case, will likely be started from a Step Function.

Enter image description here

Perhaps I am overlooking something obvious in the docs, but is it possible to modify these parameters? I would like to stay with lambda if possible, as I have had a hard time in the past wrangling ECS tasks.

profile picture
asked 4 months ago414 views
1 Answer
0

When you launch a lambda function you can pass a payload into the function. Then depending on the parameters execute a different subroutine or function as part of the lambda handler.

https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html

profile picture
EXPERT
answered 4 months ago
profile pictureAWS
EXPERT
reviewed 4 months ago
  • Thank you for the reply. What I am looking for are the parameters that I would need to pass in. Perhaps its documented somewhere, but I haven't yet seen it. For example, something in the direction of below (which doesn't work).

    {
      "FunctionName": "arn:aws:lambda:us-east-1:xxxxxxxxxx:function:quarto-poc1:$LATEST",
       "CmdOverride": "app.handler"
    }
    

    Also worth noting is if I add the CmdOverride in the payload, based on my testing the override is ignored.

  • You would have to build into your code to handle the payload and react based on the parameters

  • Ok, so to confirm, even though we have a mechanism via the web console, the same functionality doesn't exist programmatically?

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