简体   繁体   中英

How to combine context object with task input in step function Lambda invoke?

aws_stepfunctions_tasks.LambdaInvoke.__init__ takes an input_path argument, which defaults to $ - the entire task input. How can I combine that with the context object ( $$ ), since my Lambda needs information from both ? Or do I need to use something else, like the payload argument, to specify more than one input?

To pass both, the payload and context to lambda function, you will need to wrap the original input inside the another attribute for instance Payload

{
....
"ACCESS": {
      "Type": "Task",
      "Parameters": {
        "Payload.$": "$",
        "Context.$": "$$"
      },
      "Resource": "my_lambda_arn",
      "Next": "SLACK_MESSAGE"
    }
...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM