forked from cloudreach/aws-lambda-es-cleanup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
51 lines (46 loc) · 1.2 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
# serverless.yml
service: es-cleanup-lambda
provider:
name: aws
stage: prod
region: eu-west-1
profile: ${env:AWS_DEFAULT_PROFILE}
deploymentBucket:
name: ${env:S3_DEPLOYMENT_BUCKET}
environment:
es_endpoint: search-es-demo-zveqnhnhjqm5flntemgmx5iuya.eu-west-1.es.amazonaws.com
index: ".*"
skip_index: ".kibana*"
delete_after: "7"
index_format: "%Y.%m.%d"
stackTags: # Optional CF stack tags
Owner: [email protected]
Purpose: es-cleanup
Environment: PROD
iamRoleStatements:
- Effect: "Allow"
Action:
- "es:*"
Resource: "arn:aws:es:eu-west-1:123456789012:domain/es-demo/*"
# you must specify the full ARN of the AWS ES Domain
functions:
es-cleanup-lambda:
handler: es-cleanup.lambda_handler
name: es-cleanup-lambda
description: ES old index removal
runtime: python3.7
memorySize: "128"
timeout: 300
package:
exclude:
- ./**
include:
- es_cleanup.py
- LICENSE.md
- README.md
- CONTRIBUTING.md
events:
# Invoke Lambda function every night at 01.00 AM
- schedule: cron(0 1 * * ? *)
resources:
Description: "AWS Lambda: Elasticsearch Index Cleanup"