-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscrapers.template
More file actions
118 lines (109 loc) · 3.7 KB
/
scrapers.template
File metadata and controls
118 lines (109 loc) · 3.7 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
AWSTemplateFormatVersion: "2010-09-09"
Description: BigOrange.Cloud Updates scrapers
Transform: AWS::Serverless-2016-10-31
Parameters:
ActiveTableName:
Type: AWS::SSM::Parameter::Value<String>
Description: The DDB table name
# ParameterScope:
# Type: String
# Default: /boc/feed
# Description: The top-level scope for parameters in SM PS
Resources:
ReadFeedFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./functions/scrapeBlogRss
Handler: index.handler
MemorySize: 256
Timeout: 30
Runtime: nodejs16.x
ReservedConcurrentExecutions: 1
Environment:
Variables:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1"
ACTIVE_TABLE_NAME: !Ref ActiveTableName
Events:
Schedule:
Type: Schedule
Properties:
Schedule: rate(1 hour)
Input: |
{
"sources": [
{
"name": "What's New With AWS",
"url": "https://aws.amazon.com/about-aws/whats-new/recent/feed/",
"type": "blog"
},
{
"name": "API Changes",
"url": "https://awsapichanges.info/feed/feed.rss",
"type": "api"
},
{
"name": "AWS Compute Blog",
"url": "https://aws.amazon.com/blogs/compute/feed/",
"type": "blog"
},
{
"name": "AWS News Blog",
"url": "https://aws.amazon.com/blogs/aws/feed/",
"type": "blog"
},
{
"name": "Amazon Web Services Service Status",
"url": "https://status.aws.amazon.com/rss/all.rss",
"type": "status"
},
{
"name": "AWS CloudFormation Release Notes",
"url": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-cloudformation-release-notes.rss",
"type": "status"
},
{
"name": "AWS Security Blog",
"url": "https://aws.amazon.com/blogs/security/feed/",
"type": "blog"
},
{
"name": "AWS DevOps Blog",
"url": "https://aws.amazon.com/blogs/devops/feed/",
"type": "blog"
},
{
"name": "AWS Architecture Blog",
"url": "https://aws.amazon.com/blogs/architecture/feed/",
"type": "blog"
},
{
"name": "AWS Database Blog",
"url": "https://aws.amazon.com/blogs/database/feed/",
"type": "blog"
}
]
}
Policies:
- Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:UpdateItem
Resource:
- !Sub
arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${ActiveTableName}
- !Sub
arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${ActiveTableName}/*
LogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${ReadFeedFunction}
RetentionInDays: 7
# Parameter:
# Type: AWS::SSM::Parameter
# Properties:
# Name: !Sub ${ParameterScope}/
# Type: String
# Value: