-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
34 lines (28 loc) · 897 Bytes
/
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
service: new-dogs-serverless-notifier
provider:
name: aws
runtime: nodejs12.x
region: eu-west-1
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:PutItem
Resource: "arn:aws:dynamodb:eu-west-1:*:table/dogs"
environment:
TWILIO_ID: ${env:TWILIO_ID}
TWILIO_TOKEN: ${env:TWILIO_TOKEN}
TWILIO_FROM_PHONE_NUMBER: ${env:TWILIO_FROM_PHONE_NUMBER}
TWILIO_TO_PHONE_NUMBER: ${env:TWILIO_TO_PHONE_NUMBER}
functions:
scrapeDogs:
handler: handler.scrapeDogs
events:
- schedule: rate(2 hours)
plugins:
- serverless-webpack
- serverless-offline
- serverless-dotenv-plugin
# Have to comment out the dynamoDB resource once the table has been created as otherwise deployment will error
# See https://stackoverflow.com/questions/41620437/how-to-continue-deploy-if-dynamodb-table-already-exists
# resources:
# - ${file(resources/dynamo-db.yml)}