Skip to content

Commit d3525f4

Browse files
committed
resolve conflict
2 parents c921409 + 3e523f2 commit d3525f4

File tree

86 files changed

+8537
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+8537
-8
lines changed

.changelog/1830.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```release-note:new-resource
2+
tencentcloud_mysql_backup_encryption_status
3+
```
4+
5+
```release-note:new-resource
6+
tencentcloud_mysql_dr_instance_to_mater
7+
```
8+
9+
```release-note:new-resource
10+
tencentcloud_mysql_instance_encryption_operation
11+
```
12+
13+
```release-note:new-resource
14+
tencentcloud_mysql_password_complexity
15+
```
16+
17+
```release-note:new-resource
18+
tencentcloud_mysql_remote_backup_config
19+
```
20+
21+
```release-note:new-resource
22+
tencentcloud_mysql_restart_db_instances_operation
23+
```

.changelog/1835.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```release-note:new-data-source
2+
tencentcloud_ckafka_group_info
3+
```
4+
5+
```release-note:new-data-source
6+
tencentcloud_ckafka_task_status
7+
```
8+
9+
```release-note:new-data-source
10+
tencentcloud_ckafka_topic_flow_ranking
11+
```
12+
13+
```release-note:new-data-source
14+
tencentcloud_ckafka_topic_produce_connection
15+
```
16+
17+
```release-note:new-data-source
18+
tencentcloud_ckafka_topic_subscribe_group
19+
```
20+
21+
```release-note:new-data-source
22+
tencentcloud_ckafka_topic_sync_replica
23+
```

.changelog/1836.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
```release-note:new-data-source
2+
tencentcloud_scf_account_info
3+
```
4+
5+
```release-note:new-data-source
6+
tencentcloud_scf_async_event_management
7+
```
8+
9+
```release-note:new-data-source
10+
tencentcloud_scf_triggers
11+
```
12+
13+
```release-note:new-data-source
14+
tencentcloud_scf_async_event_status
15+
```
16+
17+
```release-note:new-data-source
18+
tencentcloud_scf_function_address
19+
```
20+
21+
```release-note:new-data-source
22+
tencentcloud_scf_request_status
23+
```
24+
25+
```release-note:new-data-source
26+
tencentcloud_scf_function_aliases
27+
```
28+
29+
```release-note:new-data-source
30+
tencentcloud_scf_layer_versions
31+
```
32+
33+
```release-note:new-data-source
34+
tencentcloud_scf_layers
35+
```
36+
37+
```release-note:new-data-source
38+
tencentcloud_scf_function_versions
39+
```

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ require (
3434
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.539
3535
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.627
3636
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/chdfs v1.0.600
37-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.634
37+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.666
3838
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.599
3939
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544
4040
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.663
41-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.664
41+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.666
4242
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624
4343
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.589
4444
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.572

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/chdfs v1.0.600 h1:qSpp4
794794
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/chdfs v1.0.600/go.mod h1:xud1dQ7Rc23yC5kS00TYRrvZ/A+94EOkwquaI6xGVac=
795795
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.634 h1:WL0kapIur4iVPIHHoGfwJob/dftlLmiREQ8Xa6e3mPs=
796796
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.634/go.mod h1:fe2hUV4dNLP1IVYvUrTNY5PC4J+a6Lr1Bzw0KqxJyQ8=
797+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.666 h1:uYZFM32iY46rLtvKMMv+aLoGfAM9XgCq/4+h3xu9UPQ=
798+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.666/go.mod h1:GSkOVaAn5wPunmyOLCe9m9D1hNscI4lKfOnpeByAFlc=
797799
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.599 h1:f4EuaKvy96oL1qptD1wRtq/CW3fSU1nqqyKNRNTAn0s=
798800
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.599/go.mod h1:25iHVjMmqlOBynJjf/zyV4Bub1VewvMr/QjwQUU39Pg=
799801
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 h1:ApY6rS7I9otgujOdAFy0+Epno1PNVCQmsOoWQxx724Y=
@@ -845,8 +847,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.659/go.mod
845847
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.661/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
846848
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.662/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
847849
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.663/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
848-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.664 h1:Han+TNmpXPp45uE8h8yU95QZbhglrpSl+TG7qec6eEI=
849-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.664/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
850+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.666 h1:Qa3GQYsEWTesghhQ2+dWwfRZowz10v3witlO++LmPTQ=
851+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.666/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
850852
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 h1:nEZqsoqt1pEoaP9JjkHQy3/H00suCfzlHW1qOm2nYD8=
851853
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624/go.mod h1:+TXSVyeKwt1IhZRqKPbTREteBcP+K07Q846/ilNzLWA=
852854
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.589 h1:LZihgirMH0vsaGScYexxwY0fTss9vHaSZs/YOQUVESg=
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
/*
2+
Use this data source to query detailed information of ckafka group_info
3+
4+
Example Usage
5+
6+
```hcl
7+
data "tencentcloud_ckafka_group_info" "group_info" {
8+
instance_id = "ckafka-xxxxxx"
9+
group_list = ["xxxxxx"]
10+
}
11+
```
12+
*/
13+
package tencentcloud
14+
15+
import (
16+
"context"
17+
18+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
19+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
20+
ckafka "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819"
21+
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
22+
)
23+
24+
func dataSourceTencentCloudCkafkaGroupInfo() *schema.Resource {
25+
return &schema.Resource{
26+
Read: dataSourceTencentCloudCkafkaGroupInfoRead,
27+
Schema: map[string]*schema.Schema{
28+
"instance_id": {
29+
Required: true,
30+
Type: schema.TypeString,
31+
Description: "InstanceId.",
32+
},
33+
34+
"group_list": {
35+
Required: true,
36+
Type: schema.TypeSet,
37+
Elem: &schema.Schema{
38+
Type: schema.TypeString,
39+
},
40+
Description: "Kafka consumption group, Consumer-group, here is an array format, format GroupList.0=xxx&GroupList.1=yyy.",
41+
},
42+
43+
"result": {
44+
Computed: true,
45+
Type: schema.TypeList,
46+
Description: "result.",
47+
Elem: &schema.Resource{
48+
Schema: map[string]*schema.Schema{
49+
"error_code": {
50+
Type: schema.TypeString,
51+
Computed: true,
52+
Description: "Error code, normally 0.",
53+
},
54+
"state": {
55+
Type: schema.TypeString,
56+
Computed: true,
57+
Description: "Group state description (commonly Empty, Stable, and Dead states): Dead: The consumption group does not exist Empty: The consumption group does not currently have any consumer subscriptions PreparingRebalance: The consumption group is in the rebalance state CompletingRebalance: The consumption group is in the rebalance state Stable: Each consumer in the consumption group has joined and is in a stable state.",
58+
},
59+
"protocol_type": {
60+
Type: schema.TypeString,
61+
Computed: true,
62+
Description: "The protocol type selected by the consumption group is normally the consumer, but some systems use their own protocol, such as kafka-connect, which uses connect. Only the standard consumer protocol, this interface knows the format of the specific allocation method, and can analyze the specific partition allocation.",
63+
},
64+
"protocol": {
65+
Type: schema.TypeString,
66+
Computed: true,
67+
Description: "Common consumer partition allocation algorithms are as follows (the default option for Kafka consumer SDK is range) range|roundrobin|sticky.",
68+
},
69+
"members": {
70+
Type: schema.TypeList,
71+
Computed: true,
72+
Description: "This array contains information only if state is Stable and protocol_type is consumer.",
73+
Elem: &schema.Resource{
74+
Schema: map[string]*schema.Schema{
75+
"member_id": {
76+
Type: schema.TypeString,
77+
Computed: true,
78+
Description: "ID that the coordinator generated for consumer.",
79+
},
80+
"client_id": {
81+
Type: schema.TypeString,
82+
Computed: true,
83+
Description: "The client.id information set by the client consumer SDK itself.",
84+
},
85+
"client_host": {
86+
Type: schema.TypeString,
87+
Computed: true,
88+
Description: "Generally store the customer's IP address.",
89+
},
90+
"assignment": {
91+
Type: schema.TypeList,
92+
Computed: true,
93+
Description: "Stores the partition information assigned to the consumer.",
94+
Elem: &schema.Resource{
95+
Schema: map[string]*schema.Schema{
96+
"version": {
97+
Type: schema.TypeInt,
98+
Computed: true,
99+
Description: "assignment version information.",
100+
},
101+
"topics": {
102+
Type: schema.TypeList,
103+
Computed: true,
104+
Description: "topic list.",
105+
Elem: &schema.Resource{
106+
Schema: map[string]*schema.Schema{
107+
"topic": {
108+
Type: schema.TypeString,
109+
Computed: true,
110+
Description: "Assigned topic name.",
111+
},
112+
"partitions": {
113+
Type: schema.TypeSet,
114+
Elem: &schema.Schema{
115+
Type: schema.TypeInt,
116+
},
117+
Computed: true,
118+
Description: "Allocated partition information.",
119+
},
120+
},
121+
},
122+
},
123+
},
124+
},
125+
},
126+
},
127+
},
128+
},
129+
"group": {
130+
Type: schema.TypeString,
131+
Computed: true,
132+
Description: "Kafka consumer group.",
133+
},
134+
},
135+
},
136+
},
137+
138+
"result_output_file": {
139+
Type: schema.TypeString,
140+
Optional: true,
141+
Description: "Used to save results.",
142+
},
143+
},
144+
}
145+
}
146+
147+
func dataSourceTencentCloudCkafkaGroupInfoRead(d *schema.ResourceData, meta interface{}) error {
148+
defer logElapsed("data_source.tencentcloud_ckafka_group_info.read")()
149+
defer inconsistentCheck(d, meta)()
150+
151+
logId := getLogId(contextNil)
152+
153+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
154+
155+
paramMap := make(map[string]interface{})
156+
if v, ok := d.GetOk("instance_id"); ok {
157+
paramMap["instance_id"] = helper.String(v.(string))
158+
}
159+
160+
if v, ok := d.GetOk("group_list"); ok {
161+
groupListSet := v.(*schema.Set).List()
162+
paramMap["group_list"] = helper.InterfacesStringsPoint(groupListSet)
163+
}
164+
165+
service := CkafkaService{client: meta.(*TencentCloudClient).apiV3Conn}
166+
167+
var result []*ckafka.GroupInfoResponse
168+
169+
err := resource.Retry(readRetryTimeout, func() *resource.RetryError {
170+
groupInfo, e := service.DescribeCkafkaGroupInfoByFilter(ctx, paramMap)
171+
if e != nil {
172+
return retryError(e)
173+
}
174+
result = groupInfo
175+
return nil
176+
})
177+
if err != nil {
178+
return err
179+
}
180+
181+
ids := make([]string, 0, len(result))
182+
tmpList := make([]map[string]interface{}, 0, len(result))
183+
184+
if result != nil {
185+
for _, groupInfoResponse := range result {
186+
groupInfoResponseMap := map[string]interface{}{}
187+
188+
if groupInfoResponse.ErrorCode != nil {
189+
groupInfoResponseMap["error_code"] = groupInfoResponse.ErrorCode
190+
}
191+
192+
if groupInfoResponse.State != nil {
193+
groupInfoResponseMap["state"] = groupInfoResponse.State
194+
}
195+
196+
if groupInfoResponse.ProtocolType != nil {
197+
groupInfoResponseMap["protocol_type"] = groupInfoResponse.ProtocolType
198+
}
199+
200+
if groupInfoResponse.Protocol != nil {
201+
groupInfoResponseMap["protocol"] = groupInfoResponse.Protocol
202+
}
203+
204+
if groupInfoResponse.Members != nil {
205+
membersList := []interface{}{}
206+
for _, members := range groupInfoResponse.Members {
207+
membersMap := map[string]interface{}{}
208+
209+
if members.MemberId != nil {
210+
membersMap["member_id"] = members.MemberId
211+
}
212+
213+
if members.ClientId != nil {
214+
membersMap["client_id"] = members.ClientId
215+
}
216+
217+
if members.ClientHost != nil {
218+
membersMap["client_host"] = members.ClientHost
219+
}
220+
221+
if members.Assignment != nil {
222+
assignmentMap := map[string]interface{}{}
223+
224+
if members.Assignment.Version != nil {
225+
assignmentMap["version"] = members.Assignment.Version
226+
}
227+
228+
if members.Assignment.Topics != nil {
229+
topicsList := []interface{}{}
230+
for _, topics := range members.Assignment.Topics {
231+
topicsMap := map[string]interface{}{}
232+
233+
if topics.Topic != nil {
234+
topicsMap["topic"] = topics.Topic
235+
}
236+
237+
if topics.Partitions != nil {
238+
topicsMap["partitions"] = topics.Partitions
239+
}
240+
241+
topicsList = append(topicsList, topicsMap)
242+
}
243+
244+
assignmentMap["topics"] = topicsList
245+
}
246+
247+
membersMap["assignment"] = []interface{}{assignmentMap}
248+
}
249+
250+
membersList = append(membersList, membersMap)
251+
}
252+
253+
groupInfoResponseMap["members"] = membersList
254+
}
255+
256+
if groupInfoResponse.Group != nil {
257+
groupInfoResponseMap["group"] = groupInfoResponse.Group
258+
ids = append(ids, *groupInfoResponse.Group)
259+
}
260+
261+
tmpList = append(tmpList, groupInfoResponseMap)
262+
}
263+
264+
_ = d.Set("result", tmpList)
265+
}
266+
267+
d.SetId(helper.DataResourceIdsHash(ids))
268+
output, ok := d.GetOk("result_output_file")
269+
if ok && output.(string) != "" {
270+
if e := writeToFile(output.(string), tmpList); e != nil {
271+
return e
272+
}
273+
}
274+
return nil
275+
}

0 commit comments

Comments
 (0)