-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
69 lines (64 loc) · 2.08 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# serverless.yml
service: cpas-bff-service
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: us-east-1
profile: cpas
functions:
login:
handler: index.handler
events:
- http:
path: /login
method: post
cors: true
bff:
handler: app.handler
events:
- http:
path: /home
method: get
cors: true
authorizer :
arn: arn:aws:lambda:us-east-1:821454261790:function:cpas-jwt-token-verifier-dev-cpas-jwt-token-verifier
resultTtlInSeconds: 0
identitySource: method.request.header.Authorization
identityValidationExpression: '.*'
- http:
path: /agreement/{id}
method: get
cors: true
request:
parameters:
paths:
id: true #check whether not needed
authorizer :
arn: arn:aws:lambda:us-east-1:821454261790:function:cpas-jwt-token-verifier-dev-cpas-jwt-token-verifier
resultTtlInSeconds: 0
identitySource: method.request.header.Authorization
identityValidationExpression: '.*'
- http:
path: /agreement
method: post
cors: true
authorizer :
arn: arn:aws:lambda:us-east-1:821454261790:function:cpas-jwt-token-verifier-dev-cpas-jwt-token-verifier
resultTtlInSeconds: 0
identitySource: method.request.header.Authorization
identityValidationExpression: '.*'
resources:
Resources:
GatewayResponse:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
# gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: UNAUTHORIZED
RestApiId:
Ref: 'ApiGatewayRestApi'
StatusCode: '401'
ResponseTemplates:
application/json: "{\"error\":{\"code\":\"401-unauthorized\",\"message\":$context.error.messageString},\"requestId\":\"$context.requestId\"}"