When trying to sls package
the below (for brevity I included only the relevant bits) then I’m getting an error (below is full stacktrace). Looking at the source it seems the code expects the arn value would be a string. Any solution for this? Thanks!
functions:
apighandler:
handler: apighandler.handler
events:
- http:
path: lmi
method: post
cors: true
authorizer:
name: authorizer
arn:
Fn::GetAtt:
- CognitoUserPool
- Arn
claims:
- email
resources:
Resources:
CognitoUserPool:
Type: "AWS::Cognito::UserPool"
Properties:
UserPoolName: UserPool
AdminCreateUserConfig:
AllowAdminCreateUserOnly: true
AutoVerifiedAttributes:
- email
Error:
TypeError: functionArn.split is not a function
at Object.extractAuthorizerNameFromArn (/usr/lib/node_modules/serverless/lib/plugins/aws/lib/naming.js:126:34)
at AwsCompileApigEvents.getAuthorizer (/usr/lib/node_modules/serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js:218:37)
at _.forEach (/usr/lib/node_modules/serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js:50:36)
at arrayEach (/usr/lib/node_modules/serverless/node_modules/lodash/lodash.js:537:11)
at Function.forEach (/usr/lib/node_modules/serverless/node_modules/lodash/lodash.js:9359:14)
at _.forEach (/usr/lib/node_modules/serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js:42:9)
at /usr/lib/node_modules/serverless/node_modules/lodash/lodash.js:4944:15
at baseForOwn (/usr/lib/node_modules/serverless/node_modules/lodash/lodash.js:3001:24)
at /usr/lib/node_modules/serverless/node_modules/lodash/lodash.js:4913:18
at Function.forEach (/usr/lib/node_modules/serverless/node_modules/lodash/lodash.js:9359:14)
at AwsCompileApigEvents.validate (/usr/lib/node_modules/serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js:41:7)
at Object.package:compileEvents [as hook] (/usr/lib/node_modules/serverless/lib/plugins/aws/package/compile/events/apiGateway/index.js:42:31)
at BbPromise.reduce (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:254:55)
From previous event:
at PluginManager.invoke (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:254:22)
at PluginManager.run (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:273:17)
at variables.populateService.then (/usr/lib/node_modules/serverless/lib/Serverless.js:105:33)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
at Serverless.run (/usr/lib/node_modules/serverless/lib/Serverless.js:92:74)
at serverless.init.then (/usr/lib/node_modules/serverless/bin/serverless:30:50)