Provisioned lambda correctly configured but not working as it should.

0

Hello,

I've developed an app for Slack but I've been having trouble starting it for a while now.

For those who don't know, the slack api requires a response within 3 seconds for user interaction requests, if this time passes it generates an error and the application does not work as it should.

I came to solve this problem, creating a lambda that runs every 3 minutes, invoking the main lambda, but I don't think it's the best way to do it.

With that I decided to create a lambda with provisioned concurrency, leaving 3 lambdas started. I think it was the best choice.

Turns out it's not working as it should. When I make the call, the API gateway is pointing to $LATEST, causing it to start a new lambda and I get timeout errors.

The configuration was done correctly as you can see: *The alias is called Latest (currently in version 42) *I configured it to keep 2 active lambdas *The API is configured correctly and pointing to the created Alias

Now when I make the calls it's creating a new container and pointing to the $LATEST version instead of pointing to the started lambdas. Version 42 lambdas receive one request or another at random as you can see in the logs. I really don't understand what's going on. *Logs

2 個答案
0
已接受的答案

Hello, I managed to identify the problem.

In fact, it is the slack bolt library that receives the request and, by default, forwards the request from the api to the main function, without informing the Alias, which is why I was invoking $LATEST.

I have already informed the API developers and they are checking for possible updates.

已回答 1 年前
0

Hello,

Just to confirm, provisioned Concurrency is not supported on the unpublished version of the function ($LATEST). It must be a different version of the function, or on an alias. For your case, you can create an ALIAS, and enable PC on that alias.

If that's already done, edit the Lambda function ARN in the APIGW configuration. Ensure that the field is not pointing to $LATEST. Instead, use the full function ARN, including the ALIAS (e.g., arn:aws:lambda:regions:account:function:FUNCTION-NAME:ALIAS-NAME)

profile pictureAWS
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南