Skip to content

dntsk/terraform-aws-lambda-elasticsearch-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Maintained MIT license Terraform version GitHub tag

Terraform module with AWS Lambda to cleanup ES

Terraform module which creates and deploy AWS Lambda to cleanup ElasticSearch indexes.

Supported Terraform versions

  • Terraform 0.12. Pin version to ~> v0.1

Usage

module "lambda_cleanup_elasticsearch" {
  source = "dntsk/lambda-elasticsearch-cleanup/aws"

  name = "es-cleanup"
  host = aws_elasticsearch_domain.elk.endpoint
  index_prefix = "filebeat"
  keep_days = 180

  vpc_security_group_ids = [module.elk_sg.this_security_group_id]
  vpc_subnet_ids = module.vpc.private_subnets
}

Lambda will be invoked at 3am every Sunday by CloudWatch event rule (cron).

License

MIT Licensed. See LICENSE for full details.