Skip to content

Commit 3d09890

Browse files
authored
fix(ckafka): [124743435] tencentcloud_ckafka_instance udapte specifications_type description and doc (#3404)
* add * add
1 parent 04af8e4 commit 3d09890

File tree

4 files changed

+149
-154
lines changed

4 files changed

+149
-154
lines changed

.changelog/3404.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: udapte `specifications_type` description and doc
3+
```

tencentcloud/services/ckafka/resource_tc_ckafka_instance.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ func ResourceTencentCloudCkafkaInstance() *schema.Resource {
5555
Type: schema.TypeString,
5656
Optional: true,
5757
Default: "profession",
58-
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"standard", "profession"}),
59-
Description: "Specifications type of instance. Allowed values are `standard`, `profession`. Default is `profession`.",
58+
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"standard", "profession", "premium"}),
59+
Description: "Specifications type of instance. Allowed values are `profession`, `premium`. Default is `profession`.",
6060
},
6161
"charge_type": {
6262
Type: schema.TypeString,
Lines changed: 73 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,46 @@
1-
Use this resource to create ckafka instance.
1+
Use this resource to create CKafka instance.
22

33
Example Usage
44

5-
Basic Instance
6-
```hcl
7-
variable "vpc_id" {
8-
default = "vpc-68vi2d3h"
9-
}
10-
11-
variable "subnet_id" {
12-
default = "subnet-ob6clqwk"
13-
}
5+
Create basic instance(prepaid)
146

7+
```hcl
158
data "tencentcloud_availability_zones_by_product" "gz" {
16-
name = "ap-guangzhou-3"
9+
name = "ap-guangzhou-6"
1710
product = "ckafka"
1811
}
1912
20-
resource "tencentcloud_ckafka_instance" "kafka_instance_prepaid" {
21-
instance_name = "ckafka-instance-prepaid"
22-
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
23-
period = 1
24-
vpc_id = var.vpc_id
25-
subnet_id = var.subnet_id
26-
msg_retention_time = 1300
27-
renew_flag = 0
28-
kafka_version = "2.4.1"
29-
disk_size = 200
30-
disk_type = "CLOUD_BASIC"
31-
band_width = 20
32-
partition = 400
33-
34-
specifications_type = "standard"
35-
instance_type = 2
36-
37-
config {
38-
auto_create_topic_enable = true
39-
default_num_partitions = 3
40-
default_replication_factor = 3
41-
}
13+
# create vpc
14+
resource "tencentcloud_vpc" "vpc" {
15+
name = "vpc"
16+
cidr_block = "10.0.0.0/16"
17+
}
4218
43-
dynamic_retention_config {
44-
enable = 1
45-
}
19+
# create vpc subnet
20+
resource "tencentcloud_subnet" "subnet" {
21+
name = "subnet"
22+
vpc_id = tencentcloud_vpc.vpc.id
23+
availability_zone = "ap-guangzhou-6"
24+
cidr_block = "10.0.20.0/28"
25+
is_multicast = false
4626
}
4727
48-
resource "tencentcloud_ckafka_instance" "kafka_instance_postpaid" {
49-
instance_name = "ckafka-instance-postpaid"
50-
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
51-
vpc_id = var.vpc_id
52-
subnet_id = var.subnet_id
53-
msg_retention_time = 1300
54-
kafka_version = "1.1.1"
55-
disk_size = 200
56-
band_width = 20
57-
disk_type = "CLOUD_BASIC"
58-
partition = 400
59-
charge_type = "POSTPAID_BY_HOUR"
28+
# create ckafka
29+
resource "tencentcloud_ckafka_instance" "example" {
30+
instance_name = "tf-example"
31+
zone_id = data.tencentcloud_availability_zones_by_product.gz.zones.0.id
32+
period = 1
33+
vpc_id = tencentcloud_vpc.vpc.id
34+
subnet_id = tencentcloud_subnet.subnet.id
35+
msg_retention_time = 1300
36+
renew_flag = 0
37+
kafka_version = "2.8.1"
38+
disk_size = 200
39+
disk_type = "CLOUD_BASIC"
40+
band_width = 40
41+
partition = 400
42+
specifications_type = "profession"
43+
instance_type = 1
6044
6145
config {
6246
auto_create_topic_enable = true
@@ -70,42 +54,55 @@ resource "tencentcloud_ckafka_instance" "kafka_instance_postpaid" {
7054
}
7155
```
7256

73-
Multi zone Instance
57+
Create multi zone instance(postpaid)
58+
7459
```hcl
75-
variable "vpc_id" {
76-
default = "vpc-68vi2d3h"
60+
data "tencentcloud_availability_zones_by_product" "gz6" {
61+
name = "ap-guangzhou-6"
62+
product = "ckafka"
7763
}
7864
79-
variable "subnet_id" {
80-
default = "subnet-ob6clqwk"
65+
data "tencentcloud_availability_zones_by_product" "gz7" {
66+
name = "ap-guangzhou-7"
67+
product = "ckafka"
8168
}
8269
83-
data "tencentcloud_availability_zones_by_product" "gz3" {
84-
name = "ap-guangzhou-3"
85-
product = "ckafka"
70+
# create vpc
71+
resource "tencentcloud_vpc" "vpc" {
72+
name = "vpc"
73+
cidr_block = "10.0.0.0/16"
8674
}
8775
88-
data "tencentcloud_availability_zones_by_product" "gz6" {
89-
name = "ap-guangzhou-6"
90-
product = "ckafka"
76+
# create vpc subnet
77+
resource "tencentcloud_subnet" "subnet" {
78+
name = "subnet"
79+
vpc_id = tencentcloud_vpc.vpc.id
80+
availability_zone = "ap-guangzhou-6"
81+
cidr_block = "10.0.20.0/28"
82+
is_multicast = false
9183
}
9284
93-
resource "tencentcloud_ckafka_instance" "kafka_instance" {
94-
instance_name = "ckafka-instance-maz-tf-test"
95-
zone_id = data.tencentcloud_availability_zones_by_product.gz3.zones.0.id
85+
# create ckafka
86+
resource "tencentcloud_ckafka_instance" "example" {
87+
instance_name = "tf-example"
88+
zone_id = data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
9689
multi_zone_flag = true
97-
zone_ids = [
98-
data.tencentcloud_availability_zones_by_product.gz3.zones.0.id,
99-
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id
90+
zone_ids = [
91+
data.tencentcloud_availability_zones_by_product.gz6.zones.0.id,
92+
data.tencentcloud_availability_zones_by_product.gz7.zones.0.id,
10093
]
101-
period = 1
102-
vpc_id = var.vpc_id
103-
subnet_id = var.subnet_id
104-
msg_retention_time = 1300
105-
renew_flag = 0
106-
kafka_version = "1.1.1"
107-
disk_size = 500
108-
disk_type = "CLOUD_BASIC"
94+
renew_flag = 0
95+
vpc_id = tencentcloud_vpc.vpc.id
96+
subnet_id = tencentcloud_subnet.subnet.id
97+
msg_retention_time = 4320
98+
kafka_version = "2.8.1"
99+
disk_size = 200
100+
disk_type = "CLOUD_BASIC"
101+
band_width = 20
102+
partition = 400
103+
specifications_type = "profession"
104+
charge_type = "POSTPAID_BY_HOUR"
105+
instance_type = 1
109106
110107
config {
111108
auto_create_topic_enable = true
@@ -121,8 +118,8 @@ resource "tencentcloud_ckafka_instance" "kafka_instance" {
121118

122119
Import
123120

124-
ckafka instance can be imported using the instance_id, e.g.
121+
CKafka instance can be imported using the instanceId, e.g.
125122

126123
```
127-
$ terraform import tencentcloud_ckafka_instance.foo ckafka-f9ife4zz
128-
```
124+
$ terraform import tencentcloud_ckafka_instance.example ckafka-f9ife4zz
125+
```

0 commit comments

Comments
 (0)