This repository has been archived by the owner on Feb 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathserverless.yml
78 lines (73 loc) · 2.59 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
service: aqts-capture-pruner
provider:
name: aws
rolePermissionsBoundary:
Fn::Sub:
- "arn:aws:iam::${accountId}:policy/csr-Developer-Permissions-Boundary"
- accountId:
Ref: "AWS::AccountId"
region: ${opt:region, 'us-west-2'}
stage: ${opt:stage, 'TEST'}
runtime: java11
memorySize: 384
timeout: 60
logRetentionInDays: 90
vpc: ${self:custom.vpc}
deploymentBucket:
name: ${opt:bucket, iow-cloud-applications}
stackTags:
"wma:project_id": "aqtscapture"
"wma:subSystem": "aqtscapture"
"wma:application_id": "AQTS Capture Time Series Pruner"
"wma:contact": "Jim Kreft [email protected]"
"wma:environment": ${self:provider.stage}
"wma:taggingVersion": ${opt:taggingVersion}
"wma:costCenter": TBD
"wma:organization": IOW
"displayName": "Pruner"
custom:
prune:
automatic: true
number: 3
exportGitVariables: false
vpc:
securityGroupIds: ${ssm:/iow/retriever-capture/${self:provider.stage}/securityGroupIds~split}
subnetIds: ${ssm:/iow/aws/vpc/${self:provider.stage}/subnetIds~split}
db:
connectInfo: ${ssm:/aws/reference/secretsmanager/NWCAPTURE-DB-${self:provider.stage}~true}
esLogs:
endpoint: ${ssm:/iow/aws/vpc/${self:provider.stage}/elasticsearchEndpoint}
index: ${self:service}
retentionInDays: 90
filterPattern: '?Exception ?ERROR ?WARN'
functions:
pruneTimeSeries:
handler: gov.usgs.wma.waterdata.PruneTimeSeriesHandler
role:
Fn::Sub:
- arn:aws:iam::${accountId}:role/csr-Lambda-Role
- accountId:
Ref: AWS::AccountId
events:
- schedule:
name: aqts-capture-pruner-${self:provider.stage}-event
description: "Schedule event to prune IOW's aqts-capture transform database of stale data by invoking aqts-capture-pruner lambda"
rate: cron(0 17 ? * 2#1 *)
enabled: true
reservedConcurrency: 1
environment:
FUNCTION_NAME: pruneTimeSeries
AWS_DEPLOYMENT_REGION: ${self:provider.region}
AQTS_DATABASE_ADDRESS: ${self:custom.db.connectInfo.DATABASE_ADDRESS}
AQTS_DATABASE_PORT: ${self:custom.db.connectInfo.DATABASE_PORT}
AQTS_DATABASE_NAME: ${self:custom.db.connectInfo.DATABASE_NAME}
AQTS_SCHEMA_NAME: ${self:custom.db.connectInfo.SCHEMA_NAME}
AQTS_SCHEMA_OWNER_USERNAME: ${self:custom.db.connectInfo.SCHEMA_OWNER_USERNAME}
AQTS_SCHEMA_OWNER_PASSWORD: ${self:custom.db.connectInfo.SCHEMA_OWNER_PASSWORD}
MONTHS_TO_KEEP: 2
plugins:
- serverless-plugin-git-variables
- serverless-es-logs
- serverless-prune-plugin
package:
artifact: aqts-capture-pruner-aws.jar