-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
54 lines (47 loc) · 1.2 KB
/
serverless.yml
File metadata and controls
54 lines (47 loc) · 1.2 KB
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
service: in-memory-caching # NOTE: update this with your service name
plugins:
- serverless-plugin-warmup
provider:
name: aws
runtime: java8
stage: dev
region: eu-west-1
timeout: 300
environment:
REGION: 'eu-west-1'
DATA_BUCKET: 'rvm-memory-caching-'
#Read access from lambda functions to bucket
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource:
- "arn:aws:s3:::${self:provider.environment.DATA_BUCKET}*"
- "arn:aws:s3:::${self:provider.environment.DATA_BUCKET}*/*"
package:
artifact: build/distributions/caching-${self:provider.stage}.zip
functions:
#This just creates a bucket and a file in it with some content
setup:
handler: com.rvm.SetupHandler
events:
- http:
path: setup/{id}
method: POST
request:
parameters:
paths:
id: true
read:
#Reads from a file and adds to in-memory caching
handler: com.rvm.ReadHandler
warmup: true
events:
- http:
path: data/{id}/{key}
method: GET
request:
parameters:
paths:
id: true
key: true