-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
46 lines (43 loc) · 1.36 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
service: lever-monitor
provider:
name: aws
runtime: nodejs14.x
region: us-east-1
environment:
DYNAMODB_TABLE: lever-target
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
Resource:
- !Sub "arn:aws:dynamodb:${self:provider.region}:${AWS::AccountId}:table/${self:provider.environment.DYNAMODB_TABLE}"
- Effect: Allow
Action:
- ses:SendEmail
Resource:
- !Sub "arn:aws:ses:${self:provider.region}:${AWS::AccountId}:identity/${file(./config.json):sesIdentityTo}"
- !Sub "arn:aws:ses:${self:provider.region}:${AWS::AccountId}:identity/${file(./config.json):sesIdentityFrom}"
functions:
checkTarget:
handler: handler.main
events:
- schedule: cron(0 12 ? * MON-FRI *) # M-F at 12pm UTC
environment:
LEVER_RUNTIME: remote
LEVER_TARGETS: ${file(./config.json):targets}
EMAIL_TO: ${file(./config.json):emailTo}
EMAIL_FROM: ${file(./config.json):emailFrom}
resources:
Resources:
LeverTargetTable:
Type: "AWS::DynamoDB::Table"
Properties:
AttributeDefinitions:
- AttributeName: target
AttributeType: S
KeySchema:
- AttributeName: target
KeyType: HASH
BillingMode: PAY_PER_REQUEST
TableName: ${self:provider.environment.DYNAMODB_TABLE}