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.

답변함 일 년 전
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠