Skip to content

Commit 47277bb

Browse files
authored
update ckafka doc (#1876)
* update ckafka doc * add ckafka changelog
1 parent 70ed542 commit 47277bb

File tree

3 files changed

+161
-46
lines changed

3 files changed

+161
-46
lines changed

.changelog/1876.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_ckafka_instance: deprecated the `public_network` field.
3+
```

tencentcloud/resource_tc_ckafka_instance.go

Lines changed: 79 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,85 @@ Use this resource to create ckafka instance.
55
66
Example Usage
77
8+
Basic Instance
89
```hcl
9-
resource "tencentcloud_ckafka_instance" "foo" {
10-
band_width = 40
11-
disk_size = 500
12-
disk_type = "CLOUD_BASIC"
13-
period = 1
14-
instance_name = "ckafka-instance-tf-test"
15-
specifications_type = "profession"
16-
kafka_version = "1.1.1"
17-
msg_retention_time = 1300
18-
multi_zone_flag = true
19-
partition = 800
20-
public_network = 3
21-
renew_flag = 0
22-
subnet_id = "subnet-4vwihrzk"
23-
vpc_id = "vpc-82p1t1nv"
24-
zone_id = 100006
25-
zone_ids = [
26-
100006,
27-
100007,
10+
variable "vpc_id" {
11+
default = "vpc-68vi2d3h"
12+
}
13+
14+
variable "subnet_id" {
15+
default = "subnet-ob6clqwk"
16+
}
17+
18+
data "tencentcloud_availability_zones_by_product" "gz" {
19+
name = "ap-guangzhou-3"
20+
product = "ckafka"
21+
}
22+
23+
resource "tencentcloud_ckafka_instance" "kafka_instance" {
24+
instance_name = "ckafka-instance-type-tf-test"
25+
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
26+
period = 1
27+
vpc_id = var.vpc_id
28+
subnet_id = var.subnet_id
29+
msg_retention_time = 1300
30+
renew_flag = 0
31+
kafka_version = "2.4.1"
32+
disk_size = 1000
33+
disk_type = "CLOUD_BASIC"
34+
35+
specifications_type = "standard"
36+
instance_type = 2
37+
38+
config {
39+
auto_create_topic_enable = true
40+
default_num_partitions = 3
41+
default_replication_factor = 3
42+
}
43+
44+
dynamic_retention_config {
45+
enable = 1
46+
}
47+
}
48+
```
49+
50+
Multi zone Instance
51+
```hcl
52+
variable "vpc_id" {
53+
default = "vpc-68vi2d3h"
54+
}
55+
56+
variable "subnet_id" {
57+
default = "subnet-ob6clqwk"
58+
}
59+
60+
data "tencentcloud_availability_zones_by_product" "gz3" {
61+
name = "ap-guangzhou-3"
62+
product = "ckafka"
63+
}
64+
65+
data "tencentcloud_availability_zones_by_product" "gz6" {
66+
name = "ap-guangzhou-6"
67+
product = "ckafka"
68+
}
69+
70+
resource "tencentcloud_ckafka_instance" "kafka_instance" {
71+
instance_name = "ckafka-instance-maz-tf-test"
72+
zone_id = data.tencentcloud_availability_zones_by_product.gz3.zones.0.id
73+
multi_zone_flag = true
74+
zone_ids = [
75+
data.tencentcloud_availability_zones_by_product.gz3.zones.0.id,
76+
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
2877
]
78+
period = 1
79+
vpc_id = var.vpc_id
80+
subnet_id = var.subnet_id
81+
msg_retention_time = 1300
82+
renew_flag = 0
83+
kafka_version = "1.1.1"
84+
disk_size = 500
85+
disk_type = "CLOUD_BASIC"
86+
2987
3088
config {
3189
auto_create_topic_enable = true
@@ -34,10 +92,7 @@ resource "tencentcloud_ckafka_instance" "foo" {
3492
}
3593
3694
dynamic_retention_config {
37-
bottom_retention = 0
38-
disk_quota_percentage = 0
39-
enable = 1
40-
step_forward_percentage = 0
95+
enable = 1
4196
}
4297
}
4398
```
@@ -287,6 +342,7 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource {
287342
Type: schema.TypeInt,
288343
Optional: true,
289344
Computed: true,
345+
Deprecated: "It has been deprecated from version 1.81.6. If set public network value, it will cause error.",
290346
Description: "Bandwidth of the public network.",
291347
},
292348
//"dynamic_disk_config": {

website/docs/r/ckafka_instance.html.markdown

Lines changed: 79 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,86 @@ Use this resource to create ckafka instance.
1515

1616
## Example Usage
1717

18+
Basic Instance
19+
1820
```hcl
19-
resource "tencentcloud_ckafka_instance" "foo" {
20-
band_width = 40
21-
disk_size = 500
22-
disk_type = "CLOUD_BASIC"
23-
period = 1
24-
instance_name = "ckafka-instance-tf-test"
25-
specifications_type = "profession"
26-
kafka_version = "1.1.1"
27-
msg_retention_time = 1300
28-
multi_zone_flag = true
29-
partition = 800
30-
public_network = 3
31-
renew_flag = 0
32-
subnet_id = "subnet-4vwihrzk"
33-
vpc_id = "vpc-82p1t1nv"
34-
zone_id = 100006
21+
variable "vpc_id" {
22+
default = "vpc-68vi2d3h"
23+
}
24+
25+
variable "subnet_id" {
26+
default = "subnet-ob6clqwk"
27+
}
28+
29+
data "tencentcloud_availability_zones_by_product" "gz" {
30+
name = "ap-guangzhou-3"
31+
product = "ckafka"
32+
}
33+
34+
resource "tencentcloud_ckafka_instance" "kafka_instance" {
35+
instance_name = "ckafka-instance-type-tf-test"
36+
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
37+
period = 1
38+
vpc_id = var.vpc_id
39+
subnet_id = var.subnet_id
40+
msg_retention_time = 1300
41+
renew_flag = 0
42+
kafka_version = "2.4.1"
43+
disk_size = 1000
44+
disk_type = "CLOUD_BASIC"
45+
46+
specifications_type = "standard"
47+
instance_type = 2
48+
49+
config {
50+
auto_create_topic_enable = true
51+
default_num_partitions = 3
52+
default_replication_factor = 3
53+
}
54+
55+
dynamic_retention_config {
56+
enable = 1
57+
}
58+
}
59+
```
60+
61+
Multi zone Instance
62+
63+
```hcl
64+
variable "vpc_id" {
65+
default = "vpc-68vi2d3h"
66+
}
67+
68+
variable "subnet_id" {
69+
default = "subnet-ob6clqwk"
70+
}
71+
72+
data "tencentcloud_availability_zones_by_product" "gz3" {
73+
name = "ap-guangzhou-3"
74+
product = "ckafka"
75+
}
76+
77+
data "tencentcloud_availability_zones_by_product" "gz6" {
78+
name = "ap-guangzhou-6"
79+
product = "ckafka"
80+
}
81+
82+
resource "tencentcloud_ckafka_instance" "kafka_instance" {
83+
instance_name = "ckafka-instance-maz-tf-test"
84+
zone_id = data.tencentcloud_availability_zones_by_product.gz3.zones.0.id
85+
multi_zone_flag = true
3586
zone_ids = [
36-
100006,
37-
100007,
87+
data.tencentcloud_availability_zones_by_product.gz3.zones.0.id,
88+
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
3889
]
90+
period = 1
91+
vpc_id = var.vpc_id
92+
subnet_id = var.subnet_id
93+
msg_retention_time = 1300
94+
renew_flag = 0
95+
kafka_version = "1.1.1"
96+
disk_size = 500
97+
disk_type = "CLOUD_BASIC"
3998
4099
config {
41100
auto_create_topic_enable = true
@@ -44,10 +103,7 @@ resource "tencentcloud_ckafka_instance" "foo" {
44103
}
45104
46105
dynamic_retention_config {
47-
bottom_retention = 0
48-
disk_quota_percentage = 0
49-
enable = 1
50-
step_forward_percentage = 0
106+
enable = 1
51107
}
52108
}
53109
```
@@ -70,7 +126,7 @@ The following arguments are supported:
70126
* `multi_zone_flag` - (Optional, Bool) Indicates whether the instance is multi zones. NOTE: if set to `true`, `zone_ids` must set together.
71127
* `partition` - (Optional, Int) Partition Size. Its interval varies with bandwidth, and the input must be within the interval, which can be viewed through the control. If it is not within the interval, the plan will cause a change when first created.
72128
* `period` - (Optional, Int) Prepaid purchase time, such as 1, is one month.
73-
* `public_network` - (Optional, Int) Bandwidth of the public network.
129+
* `public_network` - (Optional, Int, **Deprecated**) It has been deprecated from version 1.81.6. If set public network value, it will cause error. Bandwidth of the public network.
74130
* `rebalance_time` - (Optional, Int) Modification of the rebalancing time after upgrade.
75131
* `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).
76132
* `specifications_type` - (Optional, String) Specifications type of instance. Allowed values are `standard`, `profession`. Default is `profession`.

0 commit comments

Comments
 (0)