-
Notifications
You must be signed in to change notification settings - Fork 75
/
serverless.yml
112 lines (103 loc) · 2.61 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
service: serverless-java-goof
provider:
name: aws
runtime: java8
timeout: 30
environment:
DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}
MY_SECRET_ENV_VAR: "Tada!"
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}"
- Effect: Allow
Action:
- lambda:InvokeFunction
- lambda:InvokeAsync
Resource: "*"
package:
individually: true
functions:
createtodo:
package:
artifact: target/todo-1.0-create-fn.jar
handler: goof.handler.aws.TodoFunctionHandler
environment:
FUNCTION_NAME: CreateTodoFunction
events:
- http:
path: todos/{id}
method: put
cors: true
deletetodo:
package:
artifact: target/todo-1.0-delete-fn.jar
handler: goof.handler.aws.GetTodoFunctionHandler
environment:
FUNCTION_NAME: DeleteTodoFunction
events:
- http:
path: todos/{id}
method: delete
cors: true
updatetodo:
package:
artifact: target/todo-1.0-update-fn.jar
handler: goof.handler.aws.TodoFunctionHandler
environment:
FUNCTION_NAME: UpdateTodoFunction
events:
- http:
path: todos/{id}
method: put
cors: true
gettodo:
package:
artifact: target/todo-1.0-get-fn.jar
handler: goof.handler.aws.GetTodoFunctionHandler
environment:
FUNCTION_NAME: GetTodoFunction
events:
- http:
path: todos/{id}
method: get
cors: true
- GetResource:
type: Api
properties:
path: /{proxy+}
method: any
importtodos:
package:
artifact: target/todo-1.0-import-fn.jar
handler: goof.handler.aws.ImportTodosFunctionHandler
environment:
FUNCTION_NAME: ImportTodosFunction
events:
- http:
path: import
method: post
cors: true
todosAdmin:
package:
artifact: target/todo-1.0-import-fn.jar
handler: goof.handler.aws.ImportTodosFunctionHandler
environment:
FUNCTION_NAME: AdminTodosFunction
events:
- http:
path: import
method: post
cors: true
backuptodos:
package:
artifact: target/todo-1.0-import-fn.jar
handler: goof.handler.aws.ImportTodosFunctionHandler
environment:
FUNCTION_NAME: BackupTodosFunction