This is currently supported in HTTP api like mentioned in this issue #4771.
...
custom:
defaultStage: test
currentStage: ${opt:stage, self:custom.defaultStage}
authorizerArn:
Fn::ImportValue: MyAuthorizerArn-${self:custom.currentStage}
functions:
adminsOnly:
handler: handler.hiAdmins
events:
- http:
path: /hiAdmins
method: get
authorizer:
name: authorizer
arn: ${self:custom.authorizerArn}
But in case of websocket events, sls still tries to fetch the name of the authorizer from imported arn which is undefined at that moment.
Is it possible to do this any other way?
This is currently supported in HTTP api like mentioned in this issue #4771.
But in case of websocket events, sls still tries to fetch the name of the authorizer from imported arn which is undefined at that moment.
Is it possible to do this any other way?