alicloud_elasticsearch_instance

Provides an Elasticsearch instance resource. It contains data nodes, dedicated master node(optional) and etc. It can be associated with private IP whitelists and kibana IP whitelist. see What is Elasticsearch Instance.

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"
  instance_charge_type             = "PostPaid"
  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",
  }
}

Deleting alicloud_elasticsearch_instance or removing it from your configuration

The alicloud_elasticsearch_instance resource allows you to manage instance_charge_type = "Prepaid" Elasticsearch instance, but Terraform cannot destroy it. Deleting the subscription resource or removing it from your configuration will remove it from your state file and management, but will not destroy the Elasticsearch Instance. You can resume managing the subscription Elasticsearch instance via the AlibabaCloud Console.

Argument Reference

The following arguments are supported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Attributes Reference

The following attributes are exported:

Import

Elasticsearch can be imported using the id, e.g.

$ terraform import alicloud_elasticsearch_instance.example es-cn-abcde123456