-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yaml
41 lines (37 loc) · 1.15 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Serverless application that periodically scrapes guardian
website for favourable reviews and puts them into a trakt list.
Resources:
LambdaFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/
Handler: app.lambda_handler
Runtime: python3.10
Timeout: 30
ScheduledRule:
Type: AWS::Events::Rule
Properties:
Description: "ScheduledRule"
ScheduleExpression: "cron(0 0 * * ? *)"
State: "ENABLED"
Targets:
- Arn: !GetAtt LambdaFunction.Arn
Id:
Ref: "LambdaFunction"
InvokeLambdaPermission:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !GetAtt LambdaFunction.Arn
Action: "lambda:InvokeFunction"
Principal: "events.amazonaws.com"
SourceArn: !GetAtt ScheduledRule.Arn
Outputs:
LambdaFunction:
Description: "Guardian Films Lambda Function ARN"
Value: !GetAtt LambdaFunction.Arn
LambdaFunctionIamRole:
Description: "Implicit IAM Role created for Guardian Films function"
Value: !GetAtt LambdaFunctionRole.Arn