-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplate.yaml
48 lines (48 loc) · 1.24 KB
/
template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An AWS Serverless Specification template describing your function.
Parameters:
PhoneNumber:
Type: String
Description: Phone number to receive daily dog picture (e.g. +12223334444).
Hour:
Type: String
Default: 0
Description: What hour to send the daily doggo picture (in UTC time).
Resources:
getDogPic:
Type: 'AWS::Serverless::Function'
Properties:
Handler: getDogPic.lambda_handler
Runtime: python3.6
MemorySize: 128
Timeout: 5
CodeUri: getDogPic.py
Environment:
Variables:
SNS_TOPIC:
Ref: SNSTopic
Events:
ScheduledEvent:
Type: Schedule
Properties:
Schedule:
'Fn::Join':
- ' '
- - cron(0
- Ref: Hour
- '* * ? *)'
Policies:
- SNSPublishMessagePolicy:
TopicName:
'Fn::GetAtt':
- SNSTopic
- TopicName
SNSTopic:
Type: 'AWS::SNS::Topic'
Properties:
DisplayName: DailyDoggo
Subscription:
- Endpoint:
Ref: PhoneNumber
Protocol: sms