0

I'm building the following architecture: a user posts a string to API Gateway, which in turn calls a Lambda function - using that string as input. This Lambda function writes the string to DynamoDB. After that, this Lambda function calls another Lambda function passing as input the id of the item inserted into DynamoDB, and returns a 200 status code.

To call the second Lambda function I use:

payload = {"id":item['id']}
invoke_lambda = lambda_client.invoke(FunctionName="process",
                                     InvocationType="Event",
                                     Payload=json.dumps(payload))

How should I configure serverless.yml for the second Lambda in order for it not to use API gateway? I don't want to use API Gateway because it limits the Lambda to finish in 30 seconds.

For instance, to use API Gateway, I would just do this:

functions:
  process:
    events:
      - http: ANY /
      - http: 'ANY {proxy+}'

What's the alternative to that?

1 Answer 1

1

As long as your second Lambda function isn't attached to the API gateway then it won't be limited by anything.

So you can simply not include the "events" property in the second Lambda definition (it's an optional parameter)

Sign up to request clarification or add additional context in comments.

1 Comment

Actually, even if a function is attached to an API Gateway, you can still invoke it directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.