Hi,
I have default service and I defined custom authorizer with in that service
service: default-service
httpApi:
authorizers:
authorizer:
type: request
functionName: authorizer
identitySource: $request.header.Authorization
enableSimpleResponses: true
tenantAuthorizer:
type: request
functionName: tenantAuthorizer
identitySource: $request.header.Tenantid
enableSimpleResponses: true
cors:
allowedOrigins:
- http://localhost:4200
allowedHeaders:
- Content-Type
- Authorization
- Tenantid
functions:
apigateway:
handler: index.handler
events:
- httpApi: "*"
authorizer:
handler: src/authorizer.handler
tenantAuthorizer:
handler: src/tenantAuthorizer.handler
I would like to refer these authorisers in the other service
tenantCreate:
handler: src/handler.create
events:
- httpApi:
path: /tenants
method: post
authorizer:
type: request
id:
Ref: tenantAuthorizer
I also tried hardcoded id instead of tenantAuthorizer. but I got cloud formation error.
Please help me to achive shared authoriser?