-
Notifications
You must be signed in to change notification settings - Fork 11
/
serverless.yml
68 lines (60 loc) · 1.53 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
service: s3-directory-list
plugins:
- serverless-external-s3-event
- serverless-webpack
custom:
bucketName: ${file(custom.yml):bucketName}
darkTheme: ${file(custom.yml):darkTheme, 'false'}
provider:
name: aws
runtime: nodejs6.10
memorySize: 256
stage: dev
region: eu-west-1
profile: serverless
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ] }
- Effect: "Allow"
Action:
- "s3:PutObject"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- "Ref" : "ServerlessDeploymentBucket"
- "/*"
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource: "arn:aws:s3:::${self:custom.bucketName}"
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:PutObject"
Resource: "arn:aws:s3:::${self:custom.bucketName}/*"
- Effect: "Allow"
Action:
- "s3:PutBucketNotification"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::${self:custom.bucketName}"
functions:
generateListing:
handler: src/handler.generateListing
environment:
darkTheme: ${self:custom.darkTheme}
events:
- existingS3:
bucket: ${self:custom.bucketName}
events:
- s3:ObjectCreated:*
- s3:ObjectRemoved:*
# - s3:
# bucket: ${self:custom.bucketName}
# events:
# - s3:ObjectCreated:*
# - s3:ObjectRemoved:*