API Gateway Custom Authorizer not referencing 'provisioned' alias lambda when specifying provisioned concurrency

Hi,

Has anybody else come across this issue? I’m using:

Framework Core: 1.70.1
Plugin: 3.6.11
SDK: 2.3.0
Components: 2.30.10

I have a lambda function and custom authorizer, both using provisioned concurrency:

authenticator:
general:
name: authenticatorGeneral
type: TOKEN
# Cache authentication result for 5 minutes
resultTtlInSeconds: 300
identitySource: method.request.header.Authorization
identityValidationExpression: Bearer (.*)

functions:
  authenticatorGeneral:
    handler: src/authenticator.general
    provisionedConcurrency: 1
    reservedConcurrency: 10
    memorySize: 512
  proxy:
    handler: src/handler.server
    provisionedConcurrency: 1
    reservedConcurrency: 10
    memorySize: 1024
    events:
      - http:
          method: any
          path: /{proxy+}
          cors: true
          authorizer: ${self:custom.authenticator.general}
.....

Both these lambda functions are created with the provisioned alias and provisioning set as expected. API Gateway is mapping to the correctly aliased function for the proxy endpoint:

aura-auth-service-prod-proxy:provisioned

This works as expected, and does not suffer cold starts. If I check API Gateway for the custom authorizer mapping, it is not using the ‘provisioned’ alias:

aura-auth-service-prod-authenticatorGeneral

So I assume this will use ‘latest’, which is not provisioned? This is not working as expected and is suffering from cold starts.

Is this a known issue or am I configuring this incorrectly?

Cheers,

Rob

2 Likes

I’m also encountering this same issue. Serverless is not configuring the references properly when using provisionedConcurrency for an authorizer.

I submitted a bug report for this in github https://github.com/serverless/serverless/issues/7726

Great, thanks for the link Chris.

Hi- This is a fairly old thread, but I ran into the same issue that API Gateway not referencing ‘provisioned’ alias lambda when specifying provisioned concurrency. Following the bug report link, it is not clear that it is fixed either.

What is the best way to handle this?
Thank you.
Deniz

Great, thanks for the link Chris.thanks for sharing
Showbox jiofi.local.html