Skip to content

Commit 92ee168

Browse files
committed
Support externally managed aliases in the index resource
1 parent 858e669 commit 92ee168

File tree

9 files changed

+289
-189
lines changed

9 files changed

+289
-189
lines changed

docs/resources/elasticsearch_index.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,14 @@ provider "elasticstack" {
2121
resource "elasticstack_elasticsearch_index" "my_index" {
2222
name = "my-index"
2323
24-
alias {
24+
alias = [{
2525
name = "my_alias_1"
26-
}
27-
28-
alias {
26+
}, {
2927
name = "my_alias_2"
3028
filter = jsonencode({
3129
term = { "user.id" = "developer" }
3230
})
33-
}
31+
}]
3432
3533
mappings = jsonencode({
3634
properties = {
@@ -60,7 +58,7 @@ resource "elasticstack_elasticsearch_index" "my_index" {
6058

6159
### Optional
6260

63-
- `alias` (Block Set) Aliases for the index. (see [below for nested schema](#nestedblock--alias))
61+
- `alias` (Attributes Set) Aliases for the index. (see [below for nested schema](#nestedatt--alias))
6462
- `analysis_analyzer` (String) A JSON string describing the analyzers applied to the index.
6563
- `analysis_char_filter` (String) A JSON string describing the char_filters applied to the index.
6664
- `analysis_filter` (String) A JSON string describing the filters applied to the index.
@@ -136,7 +134,7 @@ resource "elasticstack_elasticsearch_index" "my_index" {
136134
- `id` (String) Internal identifier of the resource
137135
- `settings_raw` (String) All raw settings fetched from the cluster.
138136

139-
<a id="nestedblock--alias"></a>
137+
<a id="nestedatt--alias"></a>
140138
### Nested Schema for `alias`
141139

142140
Required:

docs/resources/elasticsearch_alias.md renamed to docs/resources/elasticsearch_index_alias.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22
---
33
# generated by https://github.com/hashicorp/terraform-plugin-docs
4-
page_title: "elasticstack_elasticsearch_alias Resource - terraform-provider-elasticstack"
5-
subcategory: "Elasticsearch"
4+
page_title: "elasticstack_elasticsearch_index_alias Resource - terraform-provider-elasticstack"
5+
subcategory: "Index"
66
description: |-
77
Manages an Elasticsearch alias. See the alias documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html for more details.
88
---
99

10-
# elasticstack_elasticsearch_alias (Resource)
10+
# elasticstack_elasticsearch_index_alias (Resource)
1111

1212
Manages an Elasticsearch alias. See the [alias documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html) for more details.
1313

examples/resources/elasticstack_elasticsearch_index/resource.tf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ provider "elasticstack" {
55
resource "elasticstack_elasticsearch_index" "my_index" {
66
name = "my-index"
77

8-
alias {
8+
alias = [{
99
name = "my_alias_1"
10-
}
11-
12-
alias {
10+
}, {
1311
name = "my_alias_2"
1412
filter = jsonencode({
1513
term = { "user.id" = "developer" }
1614
})
17-
}
15+
}]
1816

1917
mappings = jsonencode({
2018
properties = {

0 commit comments

Comments
 (0)