alicloud_elasticsearch_instance
Provides a Elasticsearch Instance resource.
For information about Elasticsearch Instance and how to use it, see What is Instance.
-> NOTE: Available since v1.30.0.
Example Usage
Basic Usage
variable "name" {
default = "tf-example"
}
data "alicloud_elasticsearch_zones" "default" {}
resource "alicloud_vpc" "default" {
vpc_name = var.name
cidr_block = "10.0.0.0/8"
}
resource "alicloud_vswitch" "default" {
vswitch_name = var.name
cidr_block = "10.1.0.0/16"
vpc_id = alicloud_vpc.default.id
zone_id = data.alicloud_elasticsearch_zones.default.zones.0.id
}
resource "alicloud_elasticsearch_instance" "default" {
description = var.name
vswitch_id = alicloud_vswitch.default.id
password = "Examplw1234"
version = "7.10_with_X-Pack"
payment_type = "PayAsYouGo"
data_node_amount = "2"
data_node_spec = "elasticsearch.sn2ne.large"
data_node_disk_size = "20"
data_node_disk_type = "cloud_ssd"
kibana_node_spec = "elasticsearch.sn2ne.large"
data_node_disk_performance_level = "PL1"
tags = {
Created = "TF",
For = "example",
}
}
Need more examples? VIEW MORE EXAMPLES
Argument Reference
The following arguments are supported:
-
vswitch_id- (Required, ForceNew) The ID of VSwitch. -
kms_encrypted_password- (Optional, Available since v1.57.1) An KMS encrypts password used to an instance. If thepasswordis filled in, this field will be ignored, but you have to specify one ofpasswordandkms_encrypted_passwordfields. -
kms_encryption_context- (Optional, MapString, Available since v1.57.1) An KMS encryption context used to decryptkms_encrypted_passwordbefore creating or updating instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. -
period- (Optional) The duration that you will buy Elasticsearch instance (in month). It is valid when PaymentType isSubscription. Valid values: [1~9], 12, 24, 36. Default to 1. From version 1.69.2, when to modify this value, the resource can renewal aPrePaidinstance. -
auto_renew_duration- (Optional, Int) Number of auto-renewal periods. -
client_node_configuration- (Optional, Computed, Set, Available since v1.267.0) Configuration of dedicated coordinating nodes in the Elasticsearch cluster. Seeclient_node_configurationbelow. -
data_node_configuration- (Optional, Computed, Set, Available since v1.267.0) Elasticsearch data node information. Seedata_node_configurationbelow. -
description- (Optional, Computed) Instance name, which supports fuzzy search. For example, searching for all instances containingabcmay return instances namedabc,abcde,xyabc, orxabcy. -
enable_kibana_private_network- (Optional, Computed, Available since v1.87.0) Indicates whether private network access to Kibana is enabled. Valid values:- true: Enabled
- false: Disabled
-
enable_kibana_public_network- (Optional, Computed, Available since v1.87.0) Specifies whether to enable public access to Kibana. Valid values:- true: Enables public access.
- false: Disables public access.
-
enable_public- (Optional, Computed, Available since v1.87.0) Specifies whether to enable a public endpoint for the instance. Valid values:- true: Enables the public endpoint.
- false: Disables the public endpoint.
-
force- (Optional, Available since v1.267.0) Whether to force a restart:- true: Yes
- false (default): No.
-> NOTE: This parameter only takes effect when other resource properties are also modified. Changing this parameter alone will not trigger a resource update.
-
instance_category- (Optional, ForceNew, Computed, Available since v1.267.0) Edition type:- x-pack: Creates a commercial edition instance, or a kernel-enhanced edition instance without Indexing Service or OpenStore enabled.
- IS: Creates a kernel-enhanced edition instance with Indexing Service or OpenStore enabled.
-
index_node_configuration- (Optional, Computed, Set, Available since v1.295.0) Configuration of index nodes for the Elasticsearch cluster. Search (query) and index nodes are supported only on Elasticsearch9.99instances and cannot coexist with data nodes, cold nodes, or coordinator nodes; a9.99instance is composed of these node roles and they are set at creation. Note: Thespecparameter is immutable after resource creation. Seeindex_node_configurationbelow. -
kibana_configuration- (Optional, Computed, Set, Available since v1.267.0) The configuration of Elasticsearch Kibana nodes. Seekibana_configurationbelow. -
kibana_private_security_group_id- (Optional) List of security groups. -
kibana_private_whitelist- (Optional, Computed, List, Available since v1.87.0) List of IP addresses in the whitelist. This parameter is available when whiteIpGroup is empty and is used to modify the default group's whitelist. -
kibana_whitelist- (Optional, Computed, List) The list of IP addresses in the whitelist. This parameter is available when whiteIpGroup is empty and modifies the default group's whitelist. -
master_configuration- (Optional, Computed, Set, Available since v1.267.0) Configuration information for Elasticsearch dedicated master nodes. Seemaster_configurationbelow. -
order_action_type- (Optional, Available since v1.267.0) Configuration change type. Valid values:- upgrade (default): Upgrade configuration
- downgrade: Downgrade configuration.
-> NOTE: This parameter only takes effect when other resource properties are also modified. Changing this parameter alone will not trigger a resource update.
-
password- (Optional) The access password for the instance. It must be 8 to 32 characters in length and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters (!@#$%^&*()_+-=). -
password_wo- (Optional, Available since v2.2.0) The write-only password of the account. It is only sent to the server when the resource is created or thepassword_wo_versionchanges and is never stored in the state or plan. -
password_wo_version- (Optional, Available since v2.2.0) The version of the write-only password. The write-only password is re-sent to the server only when this argument changes, so it must be changed wheneverpassword_wochanges. -
payment_type- (Optional, Computed, Available since v1.267.0) The billing method of the instance. Supported values:PayAsYouGo: Pay-as-you-goSubscription: Subscription
-
private_whitelist- (Optional, Computed, List) The list of IP addresses in the whitelist. This parameter is available when whiteIpGroup is empty and modifies the default group's whitelist. -
protocol- (Optional, Computed, Available since v1.101.0) The access protocol. Supported protocols: HTTP and HTTPS.-> NOTE: For instances of version 7.10 and earlier (region-dependent for 7.10), setting
protocoltoHTTPSrequires dedicated coordinating nodes. Without them, the creation fails with theHttpsNeedClientNodeerror, and coordinating nodes purchased on these versions cannot be disabled or removed afterwards. Setclient_node_configuration(or the deprecatedclient_node_specandclient_node_amount) together withprotocolon affected versions. Instances of version 7.16 and later do not require coordinating nodes forHTTPS. For more information, see FAQ about Alibaba Cloud Elasticsearch clusters. -
public_whitelist- (Optional, Computed, List) The IP address whitelist. This parameter is available when whiteIpGroup is empty and is used to modify the default group's whitelist. -
renew_status- (Optional, Computed) The renewal status. Valid values:- AutoRenewal: Auto-renewal.
- ManualRenewal: Manual renewal.
- NotRenewal: No renewal.
-
renewal_duration_unit- (Optional, Computed) The unit of the auto-renewal period. Valid values:- M: Month.
- Y: Year.
-> NOTE: This parameter is required when RenewalStatus is set to AutoRenewal.
-
resource_group_id- (Optional, Computed, Available since v1.86.0) The ID of the resource group to which the instance belongs. Updating this field moves the instance to the target resource group via ResourceManager MoveResources. -
search_node_configuration- (Optional, Computed, Set, Available since v1.295.0) Configuration of search (query) nodes for the Elasticsearch cluster. Search (query) and index nodes are supported only on Elasticsearch9.99instances and cannot coexist with data nodes, cold nodes, or coordinator nodes; a9.99instance is composed of these node roles and they are set at creation. Note: Thespecparameter is immutable after resource creation. Seesearch_node_configurationbelow. -
setting_config- (Optional, Computed, Map, Available since v1.125.0) YML configuration file settings for the instance. -
tags- (Optional, Computed, Map, Available since v1.73.0) Instance tag group. -
update_strategy- (Optional, Available since v1.267.0) Elasticsearch update strategy (for example, index updates, cluster upgrades, or service deployments). Valid values:- blue_green: Blue-green deployment, which enables seamless switching by running two identical environments (blue and green) in parallel.
- normal: In-place update, which applies changes directly in the current environment (for example, upgrades or scaling) without requiring additional resources.
- intelligent: Intelligent update, where the system automatically analyzes the update type and environment status to dynamically select the optimal strategy (either blue-green or in-place).
-> NOTE: This parameter only takes effect when other resource properties are also modified. Changing this parameter alone will not trigger a resource update.
-
version- (Required, ForceNew) The instance version. Valid values:- 8.5.1_with_X-Pack
- 7.10_with_X-Pack
- 6.7_with_X-Pack
- 7.7_with_X-Pack
- 6.8_with_X-Pack
- 6.3_with_X-Pack
- 5.6_with_X-Pack
- 5.5.3_with_X-Pack
-> NOTE: The versions listed above might not include all versions supported by Elasticsearch instances. You can call the GetRegionConfiguration operation to view the actual supported versions.
-
warm_node_configuration- (Optional, Computed, Set, Available since v1.267.0) Cold data node configuration for the Elasticsearch cluster. Seewarm_node_configurationbelow. -
zone_count- (Optional, ForceNew, Computed, Int) The number of zones for the instance. Valid values: 1, 2, and 3. Default value: 1.
The following arguments will be discarded. Please use new fields as soon as possible:
instance_charge_type- (Optional, Deprecated since v1.261.0) Valid values arePrePaid,PostPaid. Default toPostPaid. From version 1.69.0, the Elasticsearch cluster allows you to update your instance_charge_ype fromPostPaidtoPrePaid, the following attributes are required:period. Usepayment_typeinstead with valuesPayAsYouGoorSubscription.client_node_spec- (Optional, Deprecated since v1.261.0) The client node spec. If specified, client node will be created.client_node_amount- (Optional, Deprecated since v1.261.0) The Elasticsearch cluster's client node quantity, between 2 and 25.master_node_spec- (Optional, Deprecated since v1.261.0) The dedicated master node spec. If specified, dedicated master node will be created.master_node_disk_type- (Optional, Deprecated since v1.261.0) The single master node storage space. Valid values arePrePaid,PostPaid.warm_node_spec- (Optional, Deprecated since v.1.261.0) The warm node specifications of the Elasticsearch instance.warm_node_amount- (Optional, Deprecated since v1.261.0) The Elasticsearch cluster's warm node quantity, between 3 and 50.warm_node_disk_encrypted- (Optional, Deprecated since v1.261.0) If encrypt the warm node disk. Valid values aretrue,false. Default tofalse.warm_node_disk_size- (Optional, Deprecated since v.1.261.0) The single warm node storage space, should between 500 and 20480warm_node_disk_type- (Optional, Deprecated since v.1.261.0) The warm node disk type. Supported values: cloud_efficiency.kibana_node_spec- (Optional, Deprecated since v1.261.0) The kibana node specifications of the Elasticsearch instance. Default iselasticsearch.n4.small.data_node_spec- (Optional, Deprecated since v1.261.0) The data node specifications of the Elasticsearch instance.data_node_amount- (Optional, Deprecated since v1.261.0) The Elasticsearch cluster's data node quantity, between 2 and 50.data_node_disk_performance_level- (Optional, Deprecated since v1.261.0) Cloud disk performance level. Valid values arePL0,PL1,PL2,PL3. Thedata_node_disk_typemuse becloud_essd.data_node_disk_encrypted- (Optional, Deprecated since v1.261.0) If encrypt the data node disk. Valid values aretrue,false. Default tofalse.data_node_disk_type- (Optional, ForceNew, Deprecated since v1.261.0) The data node disk type. Supported values: cloud_ssd, cloud_efficiency.data_node_disk_size- (Optional, Deprecated since v1.261.0) The single data node storage space.cloud_ssd: An SSD disk, supports a maximum of 2048 GiB (2 TB).cloud_efficiencyAn ultra disk, supports a maximum of 5120 GiB (5 TB). If the data to be stored is larger than 2048 GiB, an ultra disk can only support the following data sizes (GiB): [2560,3072,3584,4096,4608,5120].
client_node_configuration
The client_node_configuration supports the following:
amount- (Optional, Int, Available since v1.267.0) Number of nodes.disk- (Optional, ForceNew, Computed, Int, Available since v1.267.0) Node storage capacity, in GB.disk_type- (Optional, ForceNew, Available since v1.267.0) Storage type of the node. Only ultra disk (cloud_efficiency) is supported.spec- (Optional) Node specification. You can view specification details in Product Specifications.
data_node_configuration
The data_node_configuration supports the following:
amount- (Optional, Computed, Int, Available since v1.267.0) Number of data nodes. Valid values: 2 to 50.disk- (Optional, Int, Available since v1.267.0) Storage capacity per node, in GB.disk_encryption- (Optional, ForceNew, Computed, Available since v1.267.0) Whether to enable cloud disk encryption:- true: Enabled
- false: Disabled.
disk_type- (Optional, ForceNew, Computed, Available since v1.267.0) Node disk type. Supported types:- cloud_ssd: SSD cloud disk
- cloud_efficiency: Ultra cloud disk.
performance_level- (Optional, Computed, Available since v1.267.0) Performance level of ESSD cloud disks. This parameter is required when diskType is set to cloud_essd. Supported values: PL1, PL2, PL3.spec- (Required, Available since v1.267.0) Node specification. For more information about specifications, see Product Specifications.
index_node_configuration
The index_node_configuration supports the following:
amount- (Optional, Computed, Int, Available since v1.295.0) Number of index nodes.disk- (Optional, Computed, Int, Available since v1.295.0) Storage capacity per node, in GB.disk_type- (Optional, ForceNew, Computed, Available since v1.295.0) Storage type of the node. ESSD (cloud_essd) is supported. Changing this forces recreation.performance_level- (Optional, Computed, Available since v1.295.0) Performance level of ESSD cloud disks. This parameter is required when diskType is set to cloud_essd. Supported values: PL1, PL2, PL3.spec- (Required, Available since v1.295.0) Node specification. Note: The parameter is immutable after resource creation. For more information about specifications, see Product Specifications.
kibana_configuration
The kibana_configuration supports the following:
amount- (Optional, ForceNew, Computed, Int, Available since v1.267.0) The number of nodes.disk- (Optional, ForceNew, Computed, Int, Available since v1.267.0) Storage capacity per node, in GB.spec- (Required, Available since v1.267.0) Node specification. For specification details, see Product Specifications.
master_configuration
The master_configuration supports the following:
amount- (Optional, ForceNew, Int, Available since v1.267.0) Number of nodes.disk- (Optional, ForceNew, Int, Available since v1.267.0) Node storage capacity, in GB.disk_type- (Optional, ForceNew, Available since v1.267.0) Node storage type. Only cloud_ssd (SSD cloud disk) is supported.spec- (Optional, Available since v1.267.0) Node specification. For specifications, see Product Specifications.
search_node_configuration
The search_node_configuration supports the following:
amount- (Optional, Computed, Int, Available since v1.295.0) Number of search (query) nodes.disk- (Optional, Computed, Int, Available since v1.295.0) Storage capacity per node, in GB.disk_type- (Optional, ForceNew, Computed, Available since v1.295.0) Storage type of the node. ESSD (cloud_essd) is supported. Changing this forces recreation.performance_level- (Optional, Computed, Available since v1.295.0) Performance level of ESSD cloud disks. This parameter is required when diskType is set to cloud_essd. Supported values: PL1, PL2, PL3.spec- (Required, Available since v1.295.0) Node specification. Note: The parameter is immutable after resource creation. For more information about specifications, see Product Specifications.
warm_node_configuration
The warm_node_configuration supports the following:
amount- (Optional, Int, Available since v1.267.0) Number of nodes.disk- (Optional, Int, Available since v1.267.0) Storage capacity per node, in GB.disk_encryption- (Optional, ForceNew, Available since v1.267.0) Whether to enable disk encryption. The values are as follows:- true: Enabled.
- false: Disabled.
disk_type- (Optional, ForceNew, Available since v1.267.0) Storage type for the node. Onlycloud_efficiency(ultra disk) is supported.spec- (Optional, Available since v1.267.0) Node specification. For specifications, see Product Specifications.
Attributes Reference
The following attributes are exported:
id- The ID of the resource supplied above.arch_type- The deployment mode or architecture type:.create_time- The time when the instance was created.domain- The internal network address of the instance.kibana_domain- Kibana endpoint.kibana_port- The access port for Kibana.kibana_private_domain- The private endpoint of Kibana.public_domain- The public endpoint of the instance.public_port- The public access port of the instance.port- Instance connection port.status- The status of the instance.
Timeouts
The timeouts block allows you to specify timeouts for certain actions:
create- (Defaults to 61 mins) Used when create the Instance.delete- (Defaults to 5 mins) Used when delete the Instance.update- (Defaults to 360 mins) Used when update the Instance.
Import
Elasticsearch Instance can be imported using the id, e.g.
$ terraform import alicloud_elasticsearch_instance.example <instance_id>