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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ