Issue when using custom authorizers with serverless-pseudo-parameters plugin
aleksdikanski opened this issue · 0 comments
aleksdikanski commented
Hi,
I stumbled upon this today:
when using the serverless-pseudo-parameters plugin, the custom authorizer support breaks.
An error occurred: AuthorizerApiGatewayAuthorizerdev - Invalid Authorizer URI: :${stageVariables.SERVERLESS_ALIAS}arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:811794430790:function:authorizer/invocations. Authorizer URI should be a valid API Gateway ARN that represents a Lambda function invocation..
Reason seems to be that the pseudo parameters plugin replaces the direct arn reference of the lambda arn:aws:lambda: ....
with a call to Cloudformation Fn::Sub
function (as intented). This break the detection of the custom authorizer as I implemented it.
...
{
"Fn::Sub": "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:authorizer"
},
...
I created a Pull Request to fix this.