-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
45 lines (43 loc) · 902 Bytes
/
main.tf
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
terraform {
required_providers {
elasticstack = {
source = "elastic/elasticstack"
version = "~> 0.6.2"
}
}
required_version = ">= 1.4.2"
}
provider "elasticstack" {
elasticsearch {
api_key = ""
endpoints = [""]
}
}
resource "elasticstack_elasticsearch_index" "my_index" {
name = "my-index"
alias {
name = "my_alias_1"
}
alias {
name = "my_alias_2"
filter = jsonencode({
term = { "user.id" = "developer" }
})
}
mappings = jsonencode({
properties = {
field1 = { type = "keyword" }
field2 = { type = "text" }
field3 = {
properties = {
inner_field1 = { type = "text", index = false }
inner_field2 = { type = "integer", index = false }
}
}
}
})
number_of_shards = 1
number_of_replicas = 2
search_idle_after = "20s"
# total_shards_per_node = 200
}