```
service:
name: ham-services-authorizer
custom:
# Our stage is based on what is passed in when running serverless
# commands. Or fallsback to what we have set in the provider section.
stage: ${opt:stage, self:provider.stage}
region: ${file(../config/config.${self:provider.stage}.yml):REGION}
provider:
name: aws
runtime: nodejs8.10
stage: dev
region: ${self:custom.region}
package:
exclude:
- node_modules/**/*
functions:
HamAuthorizer:
handler: ham-authorizer.HamAuthorizer
resources:
Resources:
ApiGatewayAuthorizer:
Type: AWS::ApiGateway::Authorizer
Properties:
Name: api-${self:custom.stage}-authorizer
Type: REQUEST
AuthorizerUri:
Fn::Join:
- ''
-
- 'arn:aws:apigateway:'
- Ref: "AWS::Region"
- ':lambda:path/2015-03-31/functions/'
- Fn::GetAtt: "HamAuthorizerLambdaFunction.Arn"
- "/invocations"
RestApiId:
'Fn::ImportValue': ${self:custom.stage}-ApiGatewayRestApiId
ApiGatewayAuthorizerPermission:
Type: AWS::Lambda::Permission
Properties:
FunctionName:
Fn::GetAtt: HamAuthorizerLambdaFunction.Arn
Action: lambda:InvokeFunction
Principal:
Fn::Join: ["",["apigateway.", { Ref: "AWS::URLSuffix"}]]
Outputs:
HamAuthorizerRef:
Value:
Ref: ApiGatewayAuthorizer
Export:
Name: ham-authorizer-ref:${self:custom.stage}
plugins:
- serverless-plugin-typescript
- serverless-pseudo-parameters
```
This is how my serverless.yml file looks like for creating an authorizer for API Gateway. But when I deploy using sls deploy I am getting below error
Serverless Error --------------------------------------- An error occurred: ApiGatewayAuthorizer - Invalid request input (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException;
What could be wrong here?