Name |
Version |
archive |
n/a |
aws |
n/a |
null |
n/a |
Name |
Description |
Type |
Default |
Required |
delete_after |
Numbers of days to preserve |
number |
15 |
no |
es_endpoint |
AWS ES FQDN e.g. search-es-demo-xxxxxxxxxx.eu-west-1.es.amazonaws.com |
string |
n/a |
yes |
index |
Index/indices to process using regex, except the one matching skip_index regex |
string |
".*" |
no |
index_format |
Combined with 'index' varible is used to evaluate the index age |
string |
"%Y.%m.%d" |
no |
prefix |
A prefix for the resource names, this helps create multiple instances of this stack for different environments |
string |
"" |
no |
python_version |
Lambda Python version to be used |
string |
"3.6" |
no |
schedule |
Cloudwatch Cron Schedule expression for running the cleanup function |
string |
"cron(0 3 * * ? *)" |
no |
security_group_ids |
Addiational Security Ids To add. |
list(string) |
[] |
no |
skip_index |
Index/indices to skip |
string |
".kibana*" |
no |
subnet_ids |
Subnet IDs you want to deploy the lambda in. Only fill this in if you want to deploy your Lambda function inside a VPC. |
list(string) |
[] |
no |
suffix |
A suffix for the resource names, this helps create multiple instances of this stack for different environments |
string |
"" |
no |
tags |
Tags to apply |
map |
{ "Name": "es-cleanup" } |
no |
timeout |
Maximum lambda execution time |
number |
300 |
no |
Name |
Description |
cloudwatch_event_arn |
AWS Cloudwatch Event ARN |
iam_role_arn |
AWS IAM ARN |
lambda_arn |
AWS Lambda ARN |
this repo is using pre-commit hook to know more click here
to manually trigger use this command
pre-commit install
pre-commit run --all-files
terraform {
required_version = ">= 0.12"
}
provider "aws" {
region = "eu-west-1"
}
module "public_es_cleanup" {
source = "github.com/cloudreach/aws-lambda-es-cleanup.git//terraform?ref=v0.14"
prefix = "public_es_"
es_endpoint = "test-es-XXXXXXX.eu-central-1.es.amazonaws.com"
delete_after = 365
}
module "vpc_es_cleanup" {
source = "github.com/cloudreach/aws-lambda-es-cleanup.git//terraform?ref=v0.14"
prefix = "vpc_es_"
es_endpoint = "vpc-gc-demo-vpc-gloo5rzcdhyiykwdlots2hdjla.eu-central-1.es.amazonaws.com"
index = "all"
delete_after = 30
subnet_ids = ["subnet-d8660da2"]
security_group_ids = ["sg-02dd3aa6da1b5"]
}
In order order to use new module version you must have terraform-provider-aws
greated than ~> 2.7
and use Terraform ~> 0.12