-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
45 lines (41 loc) · 1005 Bytes
/
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
service: hwsw-example
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: eu-west-1
iamRoleStatements:
- Effect: Allow
Action:
- 's3:*'
Resource: '*'
custom:
storageBucketName: ${self:service}-${opt:stage, self:provider.stage}-storage
functions:
authHandler:
handler: index.authHandler
cors: true
environment:
AUTH_SECRET: ${file(.env.json):AUTH_SECRET}
signedUrlHandler:
handler: index.signedUrlHandler
environment:
STORAGE_BUCKET: ${self:custom.storageBucketName}
events:
- http:
path: geturl
method: POST
authorizer: authHandler
cors: true
resources:
Resources:
StorageS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.storageBucketName}
CorsConfiguration:
CorsRules:
- AllowedHeaders: ['*']
AllowedMethods: ['GET']
MaxAge: 3000
AllowedOrigins: ['*']