From c749f134dfacf80c905f051c37e92b71aa46dab6 Mon Sep 17 00:00:00 2001 From: shanye Date: Thu, 30 May 2024 17:42:39 +0800 Subject: [PATCH] module/alicloud_elasticsearch_instance: support attributes kibana_node_spec, data_node_disk_performance_level; examples/complete: improve the examples --- examples/complete/main.tf | 28 ++++++++++++----------- examples/complete/tfvars/01-update.tfvars | 2 -- examples/complete/variables.tf | 20 ++++++++++++---- main.tf | 28 ++++++++++++----------- variables.tf | 14 +++++++++++- 5 files changed, 59 insertions(+), 33 deletions(-) diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 0cc7392..e814ae3 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -14,18 +14,20 @@ module "example" { number_of_instance = 1 - instance_charge_type = var.instance_charge_type - period = var.period - data_node_amount = var.data_node_amount - data_node_spec = var.data_node_spec - data_node_disk_size = var.data_node_disk_size - data_node_disk_type = var.data_node_disk_type - vswitch_id = module.vpc.this_vswitch_ids[0] - password = var.password - es_version = "5.5.3_with_X-Pack" - private_whitelist = var.private_whitelist - kibana_whitelist = var.kibana_whitelist - master_node_spec = var.master_node_spec - description = var.description + instance_charge_type = var.instance_charge_type + period = var.period + data_node_amount = var.data_node_amount + data_node_spec = var.data_node_spec + data_node_disk_size = var.data_node_disk_size + data_node_disk_type = var.data_node_disk_type + vswitch_id = module.vpc.this_vswitch_ids[0] + password = var.password + es_version = "7.10_with_X-Pack" + private_whitelist = var.private_whitelist + kibana_whitelist = var.kibana_whitelist + master_node_spec = var.master_node_spec + description = var.description + data_node_disk_performance_level = var.data_node_disk_performance_level + kibana_node_spec = var.kibana_node_spec } \ No newline at end of file diff --git a/examples/complete/tfvars/01-update.tfvars b/examples/complete/tfvars/01-update.tfvars index 66d56be..6114c57 100644 --- a/examples/complete/tfvars/01-update.tfvars +++ b/examples/complete/tfvars/01-update.tfvars @@ -1,11 +1,9 @@ #alicloud_elasticsearch_instance period = 2 data_node_amount = 3 -data_node_spec = "elasticsearch.sn2ne.large" data_node_disk_size = 30 data_node_disk_type = "cloud_ssd" password = "YourPassword123!Update" private_whitelist = ["172.16.0.0/21"] kibana_whitelist = ["172.16.0.0/21"] -master_node_spec = "elasticsearch.sn2ne.xlarge" description = "update-tf-description" \ No newline at end of file diff --git a/examples/complete/variables.tf b/examples/complete/variables.tf index cf574fd..1273bfc 100644 --- a/examples/complete/variables.tf +++ b/examples/complete/variables.tf @@ -19,7 +19,7 @@ variable "data_node_amount" { variable "data_node_spec" { description = "The data node specifications of the Elasticsearch instance." type = string - default = "elasticsearch.sn1ne.large" + default = "elasticsearch.sn2ne.large" } variable "data_node_disk_size" { @@ -31,7 +31,7 @@ variable "data_node_disk_size" { variable "data_node_disk_type" { description = "The data node disk type. Supported values: cloud_ssd, cloud_efficiency." type = string - default = "cloud_efficiency" + default = "cloud_ssd" } variable "password" { @@ -55,11 +55,23 @@ variable "kibana_whitelist" { variable "master_node_spec" { description = "The master node specifications of the Elasticsearch instance." type = string - default = "elasticsearch.sn2ne.large" + default = null } variable "description" { description = "The description of the Elasticsearch instance." type = string default = "tf-description" -} \ No newline at end of file +} + +variable "data_node_disk_performance_level" { + description = "The description of the Elasticsearch instance." + type = string + default = "PL1" +} + +variable "kibana_node_spec" { + description = "The description of the Elasticsearch instance." + type = string + default = "elasticsearch.sn2ne.large" +} diff --git a/main.tf b/main.tf index 58e78fb..f635e08 100644 --- a/main.tf +++ b/main.tf @@ -1,17 +1,19 @@ resource "alicloud_elasticsearch_instance" "instance" { count = var.number_of_instance - instance_charge_type = var.instance_charge_type - period = var.period - data_node_amount = var.data_node_amount - data_node_spec = var.data_node_spec - data_node_disk_size = var.data_node_disk_size - data_node_disk_type = var.data_node_disk_type - vswitch_id = var.vswitch_id - password = var.password - version = var.es_version - private_whitelist = var.private_whitelist - kibana_whitelist = var.kibana_whitelist - master_node_spec = var.master_node_spec - description = var.description + instance_charge_type = var.instance_charge_type + period = var.period + data_node_amount = var.data_node_amount + data_node_spec = var.data_node_spec + data_node_disk_size = var.data_node_disk_size + data_node_disk_type = var.data_node_disk_type + vswitch_id = var.vswitch_id + password = var.password + version = var.es_version + private_whitelist = var.private_whitelist + kibana_whitelist = var.kibana_whitelist + master_node_spec = var.master_node_spec + description = var.description + data_node_disk_performance_level = var.data_node_disk_performance_level + kibana_node_spec = var.kibana_node_spec } \ No newline at end of file diff --git a/variables.tf b/variables.tf index dedce0e..ab35ee3 100644 --- a/variables.tf +++ b/variables.tf @@ -86,4 +86,16 @@ variable "description" { description = "The description of the Elasticsearch instance." type = string default = "" -} \ No newline at end of file +} + +variable "data_node_disk_performance_level" { + description = "Cloud disk performance level. Valid values are `PL0`, `PL1`, `PL2`, `PL3`. The `data_node_disk_type` muse be `cloud_essd`." + type = string + default = null +} + +variable "kibana_node_spec" { + description = "The kibana node specifications of the Elasticsearch instance." + type = string + default = null +}