-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
65 lines (59 loc) · 1.57 KB
/
template.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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Parameters:
DynamoDBReadUnits:
Default: 5
Description: Number of DynamoDB read units to provision for each table
MaxValue: 10000
MinValue: 1
Type: Number
DynamoDBWriteUnits:
Default: 5
Description: Number of DynamoDB write units to provision for each table
MaxValue: 10000
MinValue: 1
Type: Number
LicenseEmail:
AllowedPattern: '^[a-zA-z\d]+(\.[a-zA-Z\d]+)*@[a-zA-Z\d]+(\.[a-zA-Z\d]+)+$'
Description: E-mail address to return with the server license status
Type: String
Globals:
Function:
CodeUri: ./src
Environment:
Variables:
DYNAMODB_USERS_TABLE: !Ref UsersTable
LICENSE_EMAIL: !Ref LicenseEmail
Runtime: python3.6
Timeout: 20
Resources:
UsersTable:
Type: AWS::Serverless::SimpleTable
Properties:
PrimaryKey:
Name: username
Type: String
ProvisionedThroughput:
ReadCapacityUnits: !Ref DynamoDBReadUnits
WriteCapacityUnits: !Ref DynamoDBWriteUnits
TableName: !Sub MousikeUsers-${AWS::Region}
PingFunction:
Type: AWS::Serverless::Function
Properties:
Events:
ApiCall:
Type: Api
Properties:
Path: /rest/ping
Method: get
Handler: ping.lambda_handler
GetLicenseFunction:
Type: AWS::Serverless::Function
Properties:
Events:
ApiCall:
Type: Api
Properties:
Path: /rest/getLicense
Method: get
Handler: get_license.lambda_handler