-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
62 lines (56 loc) · 1.42 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
service: import-map-deployer
custom:
bucket: 'YOUR_BUCKET'
package:
exclude:
- 'bin/*'
- 'examples/**'
- 'spec/**'
- '.vscode/**'
- '*'
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, 'dev'}
region: eu-west-1
iamRoleStatements:
- Effect: Allow
Action:
- s3:*
Resource: 'arn:aws:s3:::${self:custom.bucket}/*'
plugins:
- serverless-offline
- serverless-plugin-typescript
functions:
authorizer:
handler: src/handlers/authorizer.handler
http:
handler: src/handlers/express.handler
timeout: 2
events:
- http: ANY /
- http:
path: /{proxy+}
method: ANY
cors:
origin: '*'
allowCredentials: false
cacheControl: 'max-age=600, s-maxage=600, proxy-revalidate'
authorizer:
name: authorizer
resultTtlInSeconds: 0
identitySource: method.request.header.Authorization
type: request
resources:
Resources:
GatewayResponse:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.WWW-Authenticate: "'Basic'"
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: UNAUTHORIZED
RestApiId:
Ref: 'ApiGatewayRestApi'
StatusCode: '401'