-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yml
More file actions
61 lines (61 loc) · 2.14 KB
/
template.yml
File metadata and controls
61 lines (61 loc) · 2.14 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
# This AWS SAM template has been generated from your function's configuration. If
# your function has one or more triggers, note that the AWS resources associated
# with these triggers aren't fully specified in this template and include
# placeholder values. Open this template in AWS Infrastructure Composer or your
# favorite IDE and modify it to specify a serverless application with other AWS
# resources.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An AWS Serverless Application Model template describing your function.
Resources:
TenderCleanupHandler:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Description: >-
Scheduled function to delete tenders from BaseTender whose closing date
was over a month ago. Relies on DB cascade deletes.
MemorySize: 128
Timeout: 60
Handler: lambda_function.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
EphemeralStorage:
Size: 512
Environment:
Variables:
DB_ENDPOINT: tender-tool-db.c2hq4seoidxc.us-east-1.rds.amazonaws.com
DB_NAME: tendertool_db
DB_PASSWORD: T3nder$Tool_DB_2025!
DB_USER: CleanupAppUser
EventInvokeConfig:
MaximumEventAgeInSeconds: 21600
MaximumRetryAttempts: 2
Layers:
- !Ref Layer1
PackageType: Zip
Policies:
- Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: '*'
RecursiveLoop: Terminate
SnapStart:
ApplyOn: None
RuntimeManagementConfig:
UpdateRuntimeOn: Auto
# This resource represents your Layer with name analytics-layer. To download
# the content of your Layer, go to
#
# aws.amazon.com/go/view?arn=arn%3Aaws%3Alambda%3Aus-east-1%3A211635102441%3Alayer%3Aanalytics-layer%3A2&source=lambda
Layer1:
Type: AWS::Serverless::LayerVersion
Properties:
ContentUri: ./analytics-layer
LayerName: analytics-layer
CompatibleRuntimes:
- python3.9