Skip to content

fix(ckafka): [124743435] tencentcloud_ckafka_instance udapte specifications_type description and doc #3404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_ckafka_instance: udapte `specifications_type` description and doc
```
4 changes: 2 additions & 2 deletions tencentcloud/services/ckafka/resource_tc_ckafka_instance.go
Original file line number Diff line number Diff line change
@@ -55,8 +55,8 @@ func ResourceTencentCloudCkafkaInstance() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Default: "profession",
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"standard", "profession"}),
Description: "Specifications type of instance. Allowed values are `standard`, `profession`. Default is `profession`.",
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"standard", "profession", "premium"}),
Description: "Specifications type of instance. Allowed values are `profession`, `premium`. Default is `profession`.",
},
"charge_type": {
Type: schema.TypeString,
149 changes: 73 additions & 76 deletions tencentcloud/services/ckafka/resource_tc_ckafka_instance.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,46 @@
Use this resource to create ckafka instance.
Use this resource to create CKafka instance.

Example Usage

Basic Instance
```hcl
variable "vpc_id" {
default = "vpc-68vi2d3h"
}

variable "subnet_id" {
default = "subnet-ob6clqwk"
}
Create basic instance(prepaid)

```hcl
data "tencentcloud_availability_zones_by_product" "gz" {
name = "ap-guangzhou-3"
name = "ap-guangzhou-6"
product = "ckafka"
}

resource "tencentcloud_ckafka_instance" "kafka_instance_prepaid" {
instance_name = "ckafka-instance-prepaid"
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
period = 1
vpc_id = var.vpc_id
subnet_id = var.subnet_id
msg_retention_time = 1300
renew_flag = 0
kafka_version = "2.4.1"
disk_size = 200
disk_type = "CLOUD_BASIC"
band_width = 20
partition = 400

specifications_type = "standard"
instance_type = 2

config {
auto_create_topic_enable = true
default_num_partitions = 3
default_replication_factor = 3
}
# create vpc
resource "tencentcloud_vpc" "vpc" {
name = "vpc"
cidr_block = "10.0.0.0/16"
}

dynamic_retention_config {
enable = 1
}
# create vpc subnet
resource "tencentcloud_subnet" "subnet" {
name = "subnet"
vpc_id = tencentcloud_vpc.vpc.id
availability_zone = "ap-guangzhou-6"
cidr_block = "10.0.20.0/28"
is_multicast = false
}

resource "tencentcloud_ckafka_instance" "kafka_instance_postpaid" {
instance_name = "ckafka-instance-postpaid"
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
vpc_id = var.vpc_id
subnet_id = var.subnet_id
msg_retention_time = 1300
kafka_version = "1.1.1"
disk_size = 200
band_width = 20
disk_type = "CLOUD_BASIC"
partition = 400
charge_type = "POSTPAID_BY_HOUR"
# create ckafka
resource "tencentcloud_ckafka_instance" "example" {
instance_name = "tf-example"
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
period = 1
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.subnet.id
msg_retention_time = 1300
renew_flag = 0
kafka_version = "2.8.1"
disk_size = 200
disk_type = "CLOUD_BASIC"
band_width = 40
partition = 400
specifications_type = "profession"
instance_type = 1

config {
auto_create_topic_enable = true
@@ -70,42 +54,55 @@ resource "tencentcloud_ckafka_instance" "kafka_instance_postpaid" {
}
```

Multi zone Instance
Create multi zone instance(postpaid)

```hcl
variable "vpc_id" {
default = "vpc-68vi2d3h"
data "tencentcloud_availability_zones_by_product" "gz6" {
name = "ap-guangzhou-6"
product = "ckafka"
}

variable "subnet_id" {
default = "subnet-ob6clqwk"
data "tencentcloud_availability_zones_by_product" "gz7" {
name = "ap-guangzhou-7"
product = "ckafka"
}

data "tencentcloud_availability_zones_by_product" "gz3" {
name = "ap-guangzhou-3"
product = "ckafka"
# create vpc
resource "tencentcloud_vpc" "vpc" {
name = "vpc"
cidr_block = "10.0.0.0/16"
}

data "tencentcloud_availability_zones_by_product" "gz6" {
name = "ap-guangzhou-6"
product = "ckafka"
# create vpc subnet
resource "tencentcloud_subnet" "subnet" {
name = "subnet"
vpc_id = tencentcloud_vpc.vpc.id
availability_zone = "ap-guangzhou-6"
cidr_block = "10.0.20.0/28"
is_multicast = false
}

resource "tencentcloud_ckafka_instance" "kafka_instance" {
instance_name = "ckafka-instance-maz-tf-test"
zone_id = data.tencentcloud_availability_zones_by_product.gz3.zones.0.id
# create ckafka
resource "tencentcloud_ckafka_instance" "example" {
instance_name = "tf-example"
zone_id = data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
multi_zone_flag = true
zone_ids = [
data.tencentcloud_availability_zones_by_product.gz3.zones.0.id,
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
zone_ids = [
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id,
data.tencentcloud_availability_zones_by_product.gz7.zones.0.id,
]
period = 1
vpc_id = var.vpc_id
subnet_id = var.subnet_id
msg_retention_time = 1300
renew_flag = 0
kafka_version = "1.1.1"
disk_size = 500
disk_type = "CLOUD_BASIC"
renew_flag = 0
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.subnet.id
msg_retention_time = 4320
kafka_version = "2.8.1"
disk_size = 200
disk_type = "CLOUD_BASIC"
band_width = 20
partition = 400
specifications_type = "profession"
charge_type = "POSTPAID_BY_HOUR"
instance_type = 1

config {
auto_create_topic_enable = true
@@ -121,8 +118,8 @@ resource "tencentcloud_ckafka_instance" "kafka_instance" {

Import

ckafka instance can be imported using the instance_id, e.g.
CKafka instance can be imported using the instanceId, e.g.

```
$ terraform import tencentcloud_ckafka_instance.foo ckafka-f9ife4zz
```
$ terraform import tencentcloud_ckafka_instance.example ckafka-f9ife4zz
```
147 changes: 71 additions & 76 deletions website/docs/r/ckafka_instance.html.markdown
Original file line number Diff line number Diff line change
@@ -4,71 +4,54 @@ layout: "tencentcloud"
page_title: "TencentCloud: tencentcloud_ckafka_instance"
sidebar_current: "docs-tencentcloud-resource-ckafka_instance"
description: |-
Use this resource to create ckafka instance.
Use this resource to create CKafka instance.
---

# tencentcloud_ckafka_instance

Use this resource to create ckafka instance.
Use this resource to create CKafka instance.

## Example Usage

### Basic Instance
### Create basic instance(prepaid)

```hcl
variable "vpc_id" {
default = "vpc-68vi2d3h"
}
variable "subnet_id" {
default = "subnet-ob6clqwk"
}
data "tencentcloud_availability_zones_by_product" "gz" {
name = "ap-guangzhou-3"
name = "ap-guangzhou-6"
product = "ckafka"
}
resource "tencentcloud_ckafka_instance" "kafka_instance_prepaid" {
instance_name = "ckafka-instance-prepaid"
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
period = 1
vpc_id = var.vpc_id
subnet_id = var.subnet_id
msg_retention_time = 1300
renew_flag = 0
kafka_version = "2.4.1"
disk_size = 200
disk_type = "CLOUD_BASIC"
band_width = 20
partition = 400
specifications_type = "standard"
instance_type = 2
config {
auto_create_topic_enable = true
default_num_partitions = 3
default_replication_factor = 3
}
# create vpc
resource "tencentcloud_vpc" "vpc" {
name = "vpc"
cidr_block = "10.0.0.0/16"
}
dynamic_retention_config {
enable = 1
}
# create vpc subnet
resource "tencentcloud_subnet" "subnet" {
name = "subnet"
vpc_id = tencentcloud_vpc.vpc.id
availability_zone = "ap-guangzhou-6"
cidr_block = "10.0.20.0/28"
is_multicast = false
}
resource "tencentcloud_ckafka_instance" "kafka_instance_postpaid" {
instance_name = "ckafka-instance-postpaid"
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
vpc_id = var.vpc_id
subnet_id = var.subnet_id
msg_retention_time = 1300
kafka_version = "1.1.1"
disk_size = 200
band_width = 20
disk_type = "CLOUD_BASIC"
partition = 400
charge_type = "POSTPAID_BY_HOUR"
# create ckafka
resource "tencentcloud_ckafka_instance" "example" {
instance_name = "tf-example"
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
period = 1
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.subnet.id
msg_retention_time = 1300
renew_flag = 0
kafka_version = "2.8.1"
disk_size = 200
disk_type = "CLOUD_BASIC"
band_width = 40
partition = 400
specifications_type = "profession"
instance_type = 1
config {
auto_create_topic_enable = true
@@ -82,43 +65,55 @@ resource "tencentcloud_ckafka_instance" "kafka_instance_postpaid" {
}
```

### Multi zone Instance
### Create multi zone instance(postpaid)

```hcl
variable "vpc_id" {
default = "vpc-68vi2d3h"
data "tencentcloud_availability_zones_by_product" "gz6" {
name = "ap-guangzhou-6"
product = "ckafka"
}
variable "subnet_id" {
default = "subnet-ob6clqwk"
data "tencentcloud_availability_zones_by_product" "gz7" {
name = "ap-guangzhou-7"
product = "ckafka"
}
data "tencentcloud_availability_zones_by_product" "gz3" {
name = "ap-guangzhou-3"
product = "ckafka"
# create vpc
resource "tencentcloud_vpc" "vpc" {
name = "vpc"
cidr_block = "10.0.0.0/16"
}
data "tencentcloud_availability_zones_by_product" "gz6" {
name = "ap-guangzhou-6"
product = "ckafka"
# create vpc subnet
resource "tencentcloud_subnet" "subnet" {
name = "subnet"
vpc_id = tencentcloud_vpc.vpc.id
availability_zone = "ap-guangzhou-6"
cidr_block = "10.0.20.0/28"
is_multicast = false
}
resource "tencentcloud_ckafka_instance" "kafka_instance" {
instance_name = "ckafka-instance-maz-tf-test"
zone_id = data.tencentcloud_availability_zones_by_product.gz3.zones.0.id
# create ckafka
resource "tencentcloud_ckafka_instance" "example" {
instance_name = "tf-example"
zone_id = data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
multi_zone_flag = true
zone_ids = [
data.tencentcloud_availability_zones_by_product.gz3.zones.0.id,
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id,
data.tencentcloud_availability_zones_by_product.gz7.zones.0.id,
]
period = 1
vpc_id = var.vpc_id
subnet_id = var.subnet_id
msg_retention_time = 1300
renew_flag = 0
kafka_version = "1.1.1"
disk_size = 500
disk_type = "CLOUD_BASIC"
renew_flag = 0
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.subnet.id
msg_retention_time = 4320
kafka_version = "2.8.1"
disk_size = 200
disk_type = "CLOUD_BASIC"
band_width = 20
partition = 400
specifications_type = "profession"
charge_type = "POSTPAID_BY_HOUR"
instance_type = 1
config {
auto_create_topic_enable = true
@@ -155,7 +150,7 @@ The following arguments are supported:
* `public_network` - (Optional, Int) Bandwidth of the public network.
* `rebalance_time` - (Optional, Int) Modification of the rebalancing time after upgrade.
* `renew_flag` - (Optional, Int) Prepaid automatic renewal mark, 0 means the default state, the initial state, 1 means automatic renewal, 2 means clear no automatic renewal (user setting).
* `specifications_type` - (Optional, String) Specifications type of instance. Allowed values are `standard`, `profession`. Default is `profession`.
* `specifications_type` - (Optional, String) Specifications type of instance. Allowed values are `profession`, `premium`. Default is `profession`.
* `subnet_id` - (Optional, String) Subnet id, it will be basic network if not set.
* `tag_set` - (Optional, Map) Tag set of instance.
* `tags` - (Optional, List, **Deprecated**) It has been deprecated from version 1.78.5, because it do not support change. Use `tag_set` instead. Tags of instance. Partition size, the professional version does not need tag.
@@ -194,9 +189,9 @@ In addition to all arguments above, the following attributes are exported:

## Import

ckafka instance can be imported using the instance_id, e.g.
CKafka instance can be imported using the instanceId, e.g.

```
$ terraform import tencentcloud_ckafka_instance.foo ckafka-f9ife4zz
$ terraform import tencentcloud_ckafka_instance.example ckafka-f9ife4zz
```