40 lines
780 B
HCL
40 lines
780 B
HCL
terraform {
|
|
backend "pg" {
|
|
schema_name = "shoarma-elasticsearch"
|
|
}
|
|
|
|
required_providers {
|
|
elasticstack = {
|
|
source = "elastic/elasticstack"
|
|
version = "0.6.2"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "elasticstack" {
|
|
elasticsearch {
|
|
endpoints = ["http://maestro.dmz:14653"]
|
|
}
|
|
}
|
|
|
|
resource "elasticstack_elasticsearch_index_lifecycle" "metrics_ilm" {
|
|
name = "metrics_ilm"
|
|
|
|
delete {
|
|
min_age = "7d"
|
|
delete {}
|
|
}
|
|
}
|
|
|
|
resource "elasticstack_elasticsearch_index_template" "metrics_template" {
|
|
name = "metrics_template"
|
|
|
|
priority = 42
|
|
index_patterns = ["fluentd.cpu-*", "fluentd.memory-*", "fluentd.diskfree-*"]
|
|
|
|
template {
|
|
settings = jsonencode({
|
|
"index.lifecycle.name" = elasticstack_elasticsearch_index_lifecycle.metrics_ilm.name
|
|
})
|
|
}
|
|
}
|