Provides an ALIKAFKA consumer group resource, see What is alikafka consumer group.
Basic Usage
variable "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.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
}
resource "alicloud_alikafka_consumer_group" "default" {
consumer_id = var.name
instance_id = alicloud_alikafka_instance.default.id
}
The following arguments are supported:
instance_id
- (Required, ForceNew) ID of the ALIKAFKA Instance that owns the groups.consumer_id
- (Required, ForceNew) ID of the consumer group. The length cannot exceed 64 characters.tags
- (Optional, Available in v1.63.0+) A mapping of tags to assign to the resource.description
- (Optional, ForceNew, Available in v1.157.0+) The description of the resource.The following attributes are exported:
id
- The key
of the resource supplied above. The value is formulated as <instance_id>:<consumer_id>
.ALIKAFKA GROUP can be imported using the id, e.g.
$ terraform import alicloud_alikafka_consumer_group.group alikafka_post-cn-123455abc:consumerId