serverless/serverless
View on GitHubAWS API Gateway: Lack of support for CF intrinsic functions at `functions[].events[].http.authorizer.arn`
Open
#3,212 opened on Feb 8, 2017
bug/designcat/aws-event-api-gatewaygood first issuehelp wanted
Description
- What was the config you used?
functions:
myFunction:
handler: handler.myFunction
events:
- http:
...
authorizer:
arn: { "Fn::Join" : [ ":", [ "arn:aws:lambda", { "Ref" : "AWS::Region" }, { "Ref" : "AWS::AccountId" }, "function:myAuthorizer" ] ] }
...
- What stacktrace or error message from your provider did you see?
Serverless: Packaging service...
Type Error ---------------------------------------------
functionArn.split is not a function
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Please report this error. We think it might be a bug.
Your Environment Information -----------------------------
OS: darwin
Node Version: 4.3.2
Serverless Version: 1.6.1
Similar or dependent issues:
- #3129
Additional Data
- Serverless Framework Version you're using: 1.6.1
- Operating System: macOS Sierra 10.12.3
Proposed solution:
This report signals two issues:
1. Messed up error reporting (functionArn.split is not a function)
No need to do anything here, as such errors will be handled neatly, once schema is configured for this event (see: https://github.com/serverless/serverless/issues/8018)
2. No support for CF intrinsic functions at authorizer.arn.
See: https://github.com/serverless/serverless/issues/3212#issuecomment-696637248
- When
arnis passed in object form, requirenameproperty (validate it's existence inline, at least it might be hard to validate it with schema, and receive human friendly error message). - When
arnis passed in string form and nonameis passed. deprecate name resolution with message that it won't be auto-resolved in next major and to have authorizer named,namehas to be explicitly set in config