-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathawslambda.yaml
More file actions
42 lines (38 loc) · 1.15 KB
/
awslambda.yaml
File metadata and controls
42 lines (38 loc) · 1.15 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
A SAM template to run a Python script once a week to fetch data from eBay
and upload it to PostgreSQL.
Globals:
Function:
Runtime: python3.9
MemorySize: 128
Timeout: 60
Environment:
Variables:
EBAY_API_KEY: "<INSERT_EBAY_API_KEY>"
DB_HOST: "<INSERT_DB_HOST>"
DB_PORT: "5432"
DB_NAME: "<INSERT_DB_NAME>"
DB_USER: "<INSERT_DB_USER>"
DB_PASSWORD: "<INSERT_DB_PASSWORD>"
Resources:
EbayToPostgresFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Handler: app.lambda_handler
Policies:
- AmazonRDSFullAccess
- CloudWatchLogsFullAccess
Events:
WeeklySchedule:
Type: Schedule
Properties:
Schedule: cron(0 0 ? * MON *)
Name: "WeeklyEbayToPostgres"
Description: "Trigger a function once a week to fetch eBay data and upload to PostgreSQL DB."
Outputs:
EbayToPostgresFunctionArn:
Description: "ARN of the EbayToPostgresFunction Lambda"
Value: !GetAtt EbayToPostgresFunction.Arn