-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
65 lines (60 loc) · 1.57 KB
/
Copy pathserverless.yml
File metadata and controls
65 lines (60 loc) · 1.57 KB
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
service: eos-bpjson-api
provider:
name: aws
runtime: nodejs8.10
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Scan
Resource:
- { "Fn::GetAtt": ["EosBlockProducersInfo", "Arn" ] }
environment:
BLOCK_PRODUCER_TABLE: { "Ref": "EosBlockProducersInfo" }
functions:
cacheBpJson:
handler: handler.cacheBpJson
environment:
EOS_API_ENDPOINT: 'https://api.eosnewyork.io:443'
events:
- schedule:
name: daily block producer json cache
description: Make's api calls to retrieve bp.json from block producer's and caches in dynamoDB
rate: rate(24 hours)
enabled: true
input:
key1: null
timeout:
- 15
getAllProducers:
handler: handler.getAllProducers
environment:
EOS_API_ENDPOINT: 'https://api.eosnewyork.io:443'
events:
- http:
path: producers
method: get
cors: true
resources:
Resources:
EosBlockProducersInfo:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: producer_account_name
AttributeType: S
KeySchema:
-
AttributeName: producer_account_name
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
custom:
includeDependencies:
always:
- 'src/lib/**' # (optional) always include these globs and their dependencies
plugins:
- serverless-plugin-include-dependencies