alicloud_alikafka_instance

Provides an AliKafka instance resource.

For information about Kafka instance and how to use it, see What is alikafka instance.

Example Usage

Basic Usage

variable "instance_name" {
  default = "tf-example"
}

resource "random_integer" "default" {
  min = 10000
  max = 99999
}

data "alicloud_zones" "default" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "default" {
  cidr_block = "172.16.0.0/12"
}

resource "alicloud_vswitch" "default" {
  vpc_id     = alicloud_vpc.default.id
  cidr_block = "172.16.0.0/24"
  zone_id    = data.alicloud_zones.default.zones[0].id
}

resource "alicloud_security_group" "default" {
  vpc_id = alicloud_vpc.default.id
}

resource "alicloud_alikafka_instance" "default" {
  name           = "${var.instance_name}-${random_integer.default.result}"
  partition_num  = 50
  disk_type      = 1
  disk_size      = 500
  deploy_type    = 5
  io_max         = 20
  vswitch_id     = alicloud_vswitch.default.id
  security_group = alicloud_security_group.default.id
}

Removing alicloud_alikafka_instance from your configuration

The alicloud_alikafka_instance resource allows you to manage your alikafka instance, but Terraform cannot destroy it if your instance type is pre paid(post paid type can destroy normally). Removing this resource from your configuration will remove it from your statefile and management, but will not destroy the instance. You can resume managing the instance via the alikafka Console.

Argument Reference

The following arguments are supported:

io_max disk_size(min-max:lag) topic_quota(min-max:lag) eip_max(min-max:lag)
20 500-6100:100 50-450:1 1-160:1
30 800-6100:100 50-450:1 1-240:1
60 1400-6100:100 80-450:1 1-500:1
90 2100-6100:100 100-450:1 1-500:1
120 2700-6100:100 150-450:1 1-500:1

Attributes Reference

The following attributes are exported:

Timeouts

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

Import

AliKafka instance can be imported using the id, e.g.

$ terraform import alicloud_alikafka_instance.instance <id>