Skip to content

Commit 252fca6

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

File tree

9 files changed

+288
-186
lines changed

9 files changed

+288
-186
lines changed

docs/resources/elasticsearch_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ resource "elasticstack_elasticsearch_index" "my_index" {
2525
name = "my_alias_1"
2626
}
2727
28-
alias {
28+
alias = [{
2929
name = "my_alias_2"
3030
filter = jsonencode({
3131
term = { "user.id" = "developer" }
3232
})
33-
}
33+
}]
3434
3535
mappings = jsonencode({
3636
properties = {
@@ -60,7 +60,7 @@ resource "elasticstack_elasticsearch_index" "my_index" {
6060

6161
### Optional
6262

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

139-
<a id="nestedblock--alias"></a>
139+
<a id="nestedatt--alias"></a>
140140
### Nested Schema for `alias`
141141

142142
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)