-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
93 lines (86 loc) · 2.26 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
service: extralife
plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: "${env:DOMAIN}"
createRoute53Record: true
endpointType: "regional"
securityPolicy: tls_1_2
apiType: rest
autoDomain: false
# app and org for use with dashboard.serverless.com
#app: your-app-name
#org: your-org-name
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
frameworkVersion: "2"
provider:
name: aws
runtime: go1.x
lambdaHashingVersion: 20201221
environment:
PARTICIPANTS_TABLE: extra-life-participants-${opt:stage, "development"}
TEAMS_TABLE: extra-life-teams-${opt:stage, "development"}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:*:*:*"
package:
individually: true
patterns:
- "!./**"
- "./bin/**"
functions:
update-data:
handler: bin/update-data
events:
- schedule: rate(5 minutes)
- http:
path: update-data
method: get
get-participant:
handler: bin/get-participant
events:
- http:
path: /participants/{participantId}
method: get
get-team:
handler: bin/get-team
events:
- http:
path: /teams/{teamId}
method: get
resources:
Resources:
ExtraLifeParticipantsTable:
Type: "AWS::DynamoDB::Table"
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: participantId
AttributeType: N
KeySchema:
- AttributeName: participantId
KeyType: HASH
BillingMode: PAY_PER_REQUEST
TableName: 'extra-life-participants-${opt:stage, "development"}'
ExtraLifeTeamsTable:
Type: "AWS::DynamoDB::Table"
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: teamId
AttributeType: N
KeySchema:
- AttributeName: teamId
KeyType: HASH
BillingMode: PAY_PER_REQUEST
TableName: 'extra-life-teams-${opt:stage, "development"}'