-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
106 lines (92 loc) · 2.5 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
service: kt-robots
frameworkVersion: '2'
provider:
name: aws
runtime: java11
profile: ${opt:aws-profile, 'default'}
timeout: 30
versionFunctions: false
memorySize: 2048
stage: dev
region: us-east-1
environment:
LOG_LEVEL: INFO
GAME_STATE_TABLE:
Ref: RobotState
# iam:
# role:
# statements:
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:GetItem
- dynamodb:DeleteItem
- dynamodb:Query
- dynamodb:Scan
Resource:
- Fn::GetAtt: [ RobotState, Arn ]
- Fn::Join: [ "/", [ Fn::GetAtt: [ RobotState, Arn ], "index", "*" ] ]
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: "*"
# - Effect: Allow
# Action:
# - iam:PassRole
# - iam:ListRoles
# "Resource":
# - "arn:aws:iam::*:role/*"
package:
artifact: lambda-robots/build/libs/lambda-robots-dev-all.jar
functions:
BringYourOwnRobot:
memorySize: 2048
handler: io.onema.ktrobots.lambda.functions.BringYourOwnRobot::handleRequest
environment:
YosemiteSam:
memorySize: 2048
handler: io.onema.ktrobots.lambda.functions.YosemiteSam::handleRequest
environment:
HotShot:
memorySize: 2048
handler: io.onema.ktrobots.lambda.functions.HotShot::handleRequest
environment:
RoboDog:
memorySize: 2048
handler: io.onema.ktrobots.lambda.functions.RoboDog::handleRequest
environment:
TargetRobot:
memorySize: 2048
handler: io.onema.ktrobots.lambda.functions.TargetRobot::handleRequest
environment:
resources:
Resources:
RobotState:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: PK
AttributeType: S
KeySchema:
- AttributeName: PK
KeyType: HASH
Outputs:
YourRobotArn:
Value:
"Fn::GetAtt": [BringYourOwnRobotLambdaFunction, Arn]
Description: The is the ARN of your robot, you will need this to run your game server
YosemiteSamArn:
Value:
"Fn::GetAtt": [YosemiteSamLambdaFunction, Arn]
HotShotArn:
Value:
"Fn::GetAtt": [HotShotLambdaFunction, Arn]
RoboDogArn:
Value:
"Fn::GetAtt": [RoboDogLambdaFunction, Arn]
TargetRobotArn:
Value:
"Fn::GetAtt": [TargetRobotLambdaFunction, Arn]