forked from marcy-terui/spec2019-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
97 lines (95 loc) · 2.35 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
service: jeffpay
provider:
name: aws
runtime: python3.7
region: us-west-2
timeout: 30
environment:
TZ: Asia/Tokyo
USER_TABLE:
Ref: UserTable
WALLET_TABLE:
Ref: WalletTable
PAYMENT_HISTORY_TABLE:
Ref: PaymentHistoryTable
NOTIFICATION_ENDPOINT: "https://dkxmaha7zk.execute-api.us-west-2.amazonaws.com/prod/notification"
LOCATION_ENDPOINT: "https://dkxmaha7zk.execute-api.us-west-2.amazonaws.com/prod/location"
iamRoleStatements:
- Effect: Allow
Action:
- "dynamodb:*"
Resource:
- "*"
functions:
CreateUser:
handler: user_create.user_create
events:
- http:
path: users
method: post
WalletCharge:
handler: wallet_charge.wallet_charge
events:
- http:
path: wallet/charge
method: post
WalletUse:
handler: wallet_use.wallet_use
events:
- http:
path: wallet/use
method: post
WalletTransfer:
handler: wallet_transfer.wallet_transfer
events:
- http:
path: wallet/transfer
method: post
GetUserSummary:
handler: get_user_summary.get_user_summary
events:
- http:
path: users/{userId}/summary
method: get
GetPaymentHistory:
handler: get_payment_history.get_payment_history
events:
- http:
path: users/{userId}/history
method: get
resources:
Resources:
UserTable:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
WalletTable:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
PaymentHistoryTable:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: walletId
AttributeType: S
- AttributeName: transactionId
AttributeType: S
KeySchema:
- AttributeName: walletId
KeyType: HASH
- AttributeName: transactionId
KeyType: RANGE