Skip to content

Commit acb18d6

Browse files
committed
module/alicloud_elasticsearch_instance: support attributes kibana_node_spec, data_node_disk_performance_level; examples/complete: improve the examples
1 parent 3bc596f commit acb18d6

File tree

5 files changed

+59
-33
lines changed

5 files changed

+59
-33
lines changed

examples/complete/main.tf

+15-13
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ module "example" {
1414

1515
number_of_instance = 1
1616

17-
instance_charge_type = var.instance_charge_type
18-
period = var.period
19-
data_node_amount = var.data_node_amount
20-
data_node_spec = var.data_node_spec
21-
data_node_disk_size = var.data_node_disk_size
22-
data_node_disk_type = var.data_node_disk_type
23-
vswitch_id = module.vpc.this_vswitch_ids[0]
24-
password = var.password
25-
es_version = "5.5.3_with_X-Pack"
26-
private_whitelist = var.private_whitelist
27-
kibana_whitelist = var.kibana_whitelist
28-
master_node_spec = var.master_node_spec
29-
description = var.description
17+
instance_charge_type = var.instance_charge_type
18+
period = var.period
19+
data_node_amount = var.data_node_amount
20+
data_node_spec = var.data_node_spec
21+
data_node_disk_size = var.data_node_disk_size
22+
data_node_disk_type = var.data_node_disk_type
23+
vswitch_id = module.vpc.this_vswitch_ids[0]
24+
password = var.password
25+
es_version = "7.10_with_X-Pack"
26+
private_whitelist = var.private_whitelist
27+
kibana_whitelist = var.kibana_whitelist
28+
master_node_spec = var.master_node_spec
29+
description = var.description
30+
data_node_disk_performance_level = var.data_node_disk_performance_level
31+
kibana_node_spec = var.kibana_node_spec
3032

3133
}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#alicloud_elasticsearch_instance
22
period = 2
33
data_node_amount = 3
4-
data_node_spec = "elasticsearch.sn2ne.large"
54
data_node_disk_size = 30
65
data_node_disk_type = "cloud_ssd"
76
password = "YourPassword123!Update"
87
private_whitelist = ["172.16.0.0/21"]
98
kibana_whitelist = ["172.16.0.0/21"]
10-
master_node_spec = "elasticsearch.sn2ne.xlarge"
119
description = "update-tf-description"

examples/complete/variables.tf

+16-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ variable "data_node_amount" {
1919
variable "data_node_spec" {
2020
description = "The data node specifications of the Elasticsearch instance."
2121
type = string
22-
default = "elasticsearch.sn1ne.large"
22+
default = "elasticsearch.sn2ne.large"
2323
}
2424

2525
variable "data_node_disk_size" {
@@ -31,7 +31,7 @@ variable "data_node_disk_size" {
3131
variable "data_node_disk_type" {
3232
description = "The data node disk type. Supported values: cloud_ssd, cloud_efficiency."
3333
type = string
34-
default = "cloud_efficiency"
34+
default = "cloud_ssd"
3535
}
3636

3737
variable "password" {
@@ -55,11 +55,23 @@ variable "kibana_whitelist" {
5555
variable "master_node_spec" {
5656
description = "The master node specifications of the Elasticsearch instance."
5757
type = string
58-
default = "elasticsearch.sn2ne.large"
58+
default = null
5959
}
6060

6161
variable "description" {
6262
description = "The description of the Elasticsearch instance."
6363
type = string
6464
default = "tf-description"
65-
}
65+
}
66+
67+
variable "data_node_disk_performance_level" {
68+
description = "The description of the Elasticsearch instance."
69+
type = string
70+
default = "PL1"
71+
}
72+
73+
variable "kibana_node_spec" {
74+
description = "The description of the Elasticsearch instance."
75+
type = string
76+
default = "elasticsearch.sn2ne.large"
77+
}

main.tf

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
resource "alicloud_elasticsearch_instance" "instance" {
22
count = var.number_of_instance
33

4-
instance_charge_type = var.instance_charge_type
5-
period = var.period
6-
data_node_amount = var.data_node_amount
7-
data_node_spec = var.data_node_spec
8-
data_node_disk_size = var.data_node_disk_size
9-
data_node_disk_type = var.data_node_disk_type
10-
vswitch_id = var.vswitch_id
11-
password = var.password
12-
version = var.es_version
13-
private_whitelist = var.private_whitelist
14-
kibana_whitelist = var.kibana_whitelist
15-
master_node_spec = var.master_node_spec
16-
description = var.description
4+
instance_charge_type = var.instance_charge_type
5+
period = var.period
6+
data_node_amount = var.data_node_amount
7+
data_node_spec = var.data_node_spec
8+
data_node_disk_size = var.data_node_disk_size
9+
data_node_disk_type = var.data_node_disk_type
10+
vswitch_id = var.vswitch_id
11+
password = var.password
12+
version = var.es_version
13+
private_whitelist = var.private_whitelist
14+
kibana_whitelist = var.kibana_whitelist
15+
master_node_spec = var.master_node_spec
16+
description = var.description
17+
data_node_disk_performance_level = var.data_node_disk_performance_level
18+
kibana_node_spec = var.kibana_node_spec
1719
}

variables.tf

+13-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,16 @@ variable "description" {
8686
description = "The description of the Elasticsearch instance."
8787
type = string
8888
default = ""
89-
}
89+
}
90+
91+
variable "data_node_disk_performance_level" {
92+
description = "Cloud disk performance level. Valid values are `PL0`, `PL1`, `PL2`, `PL3`. The `data_node_disk_type` muse be `cloud_essd`."
93+
type = string
94+
default = null
95+
}
96+
97+
variable "kibana_node_spec" {
98+
description = "The kibana node specifications of the Elasticsearch instance."
99+
type = string
100+
default = null
101+
}

0 commit comments

Comments
 (0)