skip to Main Content

From an architecture point of view, when an AWS Step Functions invoke a Lambda, does it go through API Gateway or does the invocation happen directly?

2

Answers


  1. The AWS Step Functions service directly invokes Lambda functions – there is no need for the Step Function service to go via another AWS service to invoke a Lambda.

    You can see the lambda:InvokeFunction IAM permission needed by the service, in the AWS Lambda IAM policy template within the Step Function docs. There is no permission required for the API gateway.

    You also wouldn’t have the option to specify the InvocationType if it went via the API Gateway.

    Login or Signup to reply.
  2. To add to the above answer, when you create an Amazon States Language document, you can reference the ARN of the Lambda function. That is how AWS Step Functions invoke an AWS Lambda function. For example:

     {
            "Comment": "A simple AWS Step Functions state machine that automates a call center support session.",
            "StartAt": "Open Case",
            "States": {
            "Open Case": {
            "Type": "Task",
            **"Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION_NAME",**
            "Next": "Assign Case"
              },
             "Assign Case": {
             "Type": "Task",
             "Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION_NAME",
             "Next": "Send Email"
             },
             "Send Email": {
             "Type": "Task",
             "Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION_NAME",
             "End": true
              }
              }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search