-
Notifications
You must be signed in to change notification settings - Fork 17
/
serverless.yml
77 lines (73 loc) · 1.52 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
70
71
72
73
74
75
76
77
service: serverless-crud-s3
plugins:
- serverless-offline
provider:
name: aws
runtime: nodejs12.x
region: us-east-1
cfLogs: true
stage: dev
iamRoleStatements:
- Effect: Allow
Action:
- s3:ListBucket
Resource: "arn:aws:s3:::form-response"
- Effect: Allow
Action:
- s3:PutObject
- s3:GetObject
- s3:DeleteObject
Resource: "arn:aws:s3:::form-response/*"
functions:
create:
handler: handler.create
events:
- http:
path: form-response/{id}
method: post
cors: true
list:
handler: handler.list
events:
- http:
path: form-response
method: get
cors: true
readAll:
handler: handler.readAll
events:
- http:
path: form-response/readAll
method: get
cors: true
readOne:
handler: handler.readOne
events:
- http:
path: form-response/{id}
method: get
cors: true
update:
handler: handler.update
events:
- http:
path: form-response/{id}
method: put
cors: true
delete:
handler: handler.delete
events:
- http:
path: form-response/{id}
method: delete
cors: true
resources:
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: form-response
AccessControl: PublicReadWrite
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: error.html