-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
serverless.yml
67 lines (62 loc) · 1.61 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
service: spider-less
provider:
name: aws
runtime: nodejs12.x
region: ${self:custom.defaultRegion}
stage: ${env:NODE_ENV, self:custom.defaultNodeEnv}
environment:
NODE_ENV: ${env:NODE_ENV, self:custom.defaultNodeEnv}
REGION: ${self:provider.region}
TABLE_SUBSCRIPTIONS: ${self:service}-subscriptions-${self:provider.stage}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/*"
functions:
http:
handler: src/index.api
timeout: 30
events:
- http:
path: /{proxy+}
method: any
cors: true
cron:
handler: src/index.cron
timeout: 60
events:
- schedule:
rate: rate(60 minutes)
scrape:
handler: src/index.scrape
timeout: 60
memorySize: 1536
resources:
Resources:
SubscriptionsTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain # Keeps around the DynamoDB resource when we redeploy/destroy
Properties:
TableName: ${self:provider.environment.TABLE_SUBSCRIPTIONS}
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
plugins:
- serverless-offline
custom:
defaultRegion: us-east-1
defaultNodeEnv: dev
serverless-offline:
dontPrintOutput: true