-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserverless.yml
More file actions
80 lines (77 loc) · 1.96 KB
/
serverless.yml
File metadata and controls
80 lines (77 loc) · 1.96 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
service: webscraper
frameworkVersion: '2'
provider:
name: aws
runtime: nodejs12.x
lambdaHashingVersion: '20201221'
region: us-east-1
stage: dev
layers:
- arn:aws:lambda:us-east-1:585135459468:layer:chrome-aws-lambda:1
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: 'arn:aws:dynamodb:us-east-1:*:table/rates'
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
Resource: 'arn:aws:dynamodb:us-east-1:*:table/rates/index/*'
functions:
scraper:
handler: src/handler.scraper
timeout: 60
environment:
${file(env.yml):}
api:
handler: src/api.handler
events:
- http:
path: /
method: ANY
- http:
path: /{proxy+}
method: ANY
resources:
Resources:
webscraper:
Type: AWS::DynamoDB::Table
Properties:
TableName: rates
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: source
AttributeType: S
- AttributeName: date
AttributeType: S
- AttributeName: buy
AttributeType: N
- AttributeName: sell
AttributeType: N
- AttributeName: avg
AttributeType: N
KeySchema:
- AttributeName: id
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: source-index
KeySchema:
- AttributeName: source
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1