-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
82 lines (75 loc) · 1.99 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
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
service: job-scraper
provider:
name: aws
runtime: python3.9
environment:
STAGE: ${opt:stage}
stackName: dev-job-scraper
deploymentBucket:
name: job-scraper-artifacts
custom:
pythonRequirements:
dockerizePip: non-linux
usePoetry: false
package:
exclude:
- node_modules/**
- package-lock.json
- requirements.txt
- __pycache__
functions:
job_scraper:
handler: job_scraper/main.lambda_handler
name: dev-job-scraper
timeout: 600
events:
- schedule:
name: job-scraper-week
description: "Calls the Lambda function to scrape the website during the week + Saturday until mid day"
rate: cron(0 18-9 ? * SUN-FRI *)
- schedule:
name: job-scraper-weekend
description: "Calls the Lambda function to scrape the website once on Sunday"
rate: cron(0 23 ? * SAT *)
iamRoleStatementsName: dev-job-scraper-role
iamRoleStatements:
- Effect: "Allow"
Action:
- dynamodb:PutItem
Resource:
- "*"
- Effect: "Allow"
Action:
- secretsmanager:GetSecretValue
Resource:
- "*"
resources:
Resources:
jobsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: job-scraper
AttributeDefinitions:
- AttributeName: id
AttributeType: N
- AttributeName: enriched
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
GlobalSecondaryIndexes:
- IndexName: enriched-global-index
KeySchema:
- AttributeName: enriched
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
plugins:
- serverless-python-requirements
- serverless-iam-roles-per-function