-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
41 lines (36 loc) · 868 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
35
36
37
38
39
40
41
service: nba-alert-system
provider:
name: aws
runtime: python3.9
region: us-east-1
stage: dev
environment:
NBA_API_KEY: ${env:NBA_API_KEY}
SNS_TOPIC_ARN: !Ref SNSTopic
iamRoleStatements:
- Effect: "Allow"
Action:
- "sns:Publish"
Resource: !Ref SNSTopic
functions:
nbaAlert:
handler: main.lambda_handler
events:
- eventBridge:
schedule: cron(0 9-23/2 * * ? *)
- eventBridge:
schedule: cron(0 0-2/2 * * ? *)
environment:
SNS_TOPIC_ARN: ${self:provider.environment.SNS_TOPIC_ARN}
resources:
Resources:
SNSTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: nba-game-alerts
SNSTopicSubscription:
Type: AWS::SNS::Subscription
Properties:
Protocol: email
Endpoint: ${env:SNS_EMAIL}
TopicArn: !Ref SNSTopic