Skip to content

Commit 573d02d

Browse files
lexwonglexwong
authored andcommitted
imporve(elasticsearch): update the module to the format of the new version.
1 parent c1bdc80 commit 573d02d

File tree

7 files changed

+31
-18
lines changed

7 files changed

+31
-18
lines changed

example/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ module "instance" {
99
vswitch_id = "vswitch id"
1010
master_node_spec = "elasticsearch.sn2ne.large"
1111
}
12+

example/outputs.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
output "elasticsearch_ids" {
2-
value = "${module.instance.elasticsearch_ids}"
2+
value = module.instance.elasticsearch_ids
33
}
4+

example/versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
terraform {
3+
required_version = ">= 0.12"
4+
}

main.tf

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
#########################
44

55
resource "alicloud_elasticsearch_instance" "instance" {
6-
instance_charge_type = "${var.instance_charge_type}"
7-
data_node_amount = "${var.data_node_amount}"
8-
data_node_spec = "${var.data_node_spec}"
9-
data_node_disk_size = "${var.data_node_disk_size}"
10-
data_node_disk_type = "${var.data_node_disk_type}"
11-
vswitch_id = "${var.vswitch_id}"
12-
password = "${var.password}"
13-
version = "${var.es_version}"
14-
count = "${var.number_of_instance}"
15-
private_whitelist = "${var.private_whitelist}"
16-
kibana_whitelist = "${var.kibana_whitelist}"
17-
description = "${var.description}"
18-
master_node_spec = "${var.master_node_spec}"
19-
period = "${var.period}"
6+
instance_charge_type = var.instance_charge_type
7+
data_node_amount = var.data_node_amount
8+
data_node_spec = var.data_node_spec
9+
data_node_disk_size = var.data_node_disk_size
10+
data_node_disk_type = var.data_node_disk_type
11+
vswitch_id = var.vswitch_id
12+
password = var.password
13+
version = var.es_version
14+
count = var.number_of_instance
15+
private_whitelist = var.private_whitelist
16+
kibana_whitelist = var.kibana_whitelist
17+
description = var.description
18+
master_node_spec = var.master_node_spec
19+
period = var.period
2020
}
21+

outputs.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
output "elasticsearch_ids" {
2-
value = "${join(",", alicloud_elasticsearch_instance.instance.*.id)}"
2+
value = join(",", alicloud_elasticsearch_instance.instance.*.id)
33
}
4+

variables.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ variable "password" {
3737
}
3838

3939
variable "private_whitelist" {
40-
type = "list"
40+
type = list(string)
4141
description = "Set the instance's IP whitelist in VPC network."
4242
default = ["0.0.0.0/0"]
4343
}
4444

4545
variable "kibana_whitelist" {
46-
type = "list"
46+
type = list(string)
4747
description = "Set the Kibana's IP whitelist in internet network."
4848
default = ["0.0.0.0/0"]
4949
}
@@ -62,3 +62,4 @@ variable "number_of_instance" {
6262
description = "Instance count"
6363
default = 1
6464
}
65+

versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
terraform {
3+
required_version = ">= 0.12"
4+
}

0 commit comments

Comments
 (0)