Skip to content

Commit efa7b82

Browse files
gitmknanonymous
andauthored
Fix/redis conn (#1982)
* fix: modify redis conn * fix: tencentcloud_mysql_parameter_list support 8.0 * feat: add changelog --------- Co-authored-by: anonymous <anonymous@mail.org>
1 parent bd46bf1 commit efa7b82

File tree

7 files changed

+68
-19
lines changed

7 files changed

+68
-19
lines changed

.changelog/1982.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:new-resource
2+
tencentcloud_redis_connection_config
3+
```
4+
5+
```release-note:enhancement
6+
datasource/tencentcloud_mysql_parameter_list: support mysql8.0
7+
```

tencentcloud/data_source_tc_mysql_parameter_list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ func dataSourceTencentCloudMysqlParameterList() *schema.Resource {
8888
"engine_version": {
8989
Type: schema.TypeString,
9090
Optional: true,
91-
ValidateFunc: validateAllowedStringValue([]string{"5.1", "5.5", "5.6", "5.7"}),
92-
Description: "The version number of the database engine to use. Supported versions include 5.5/5.6/5.7.",
91+
ValidateFunc: validateAllowedStringValue([]string{"5.1", "5.5", "5.6", "5.7", "8.0"}),
92+
Description: "The version number of the database engine to use. Supported versions include 5.5/5.6/5.7/8.0.",
9393
},
9494
"result_output_file": {
9595
Type: schema.TypeString,

tencentcloud/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ TencentDB for Redis(crs)
770770
tencentcloud_redis_replicate_attachment
771771
tencentcloud_redis_backup_operation
772772
tencentcloud_redis_security_group_attachment
773+
tencentcloud_redis_connection_config
773774
774775
Serverless Cloud Function(SCF)
775776
Data Source

tencentcloud/resource_tc_redis_connection_config.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Example Usage
55
66
```hcl
77
resource "tencentcloud_redis_connection_config" "connection_config" {
8-
instance_id = "crs-c1nl9rpv"
9-
client_limit = "20000"
10-
bandwidth = "20"
8+
instance_id = "crs-fhm9fnv1"
9+
client_limit = "20000"
10+
add_bandwidth = "30"
1111
}
1212
1313
```
@@ -53,14 +53,7 @@ func resourceTencentCloudRedisConnectionConfig() *schema.Resource {
5353
"client_limit": {
5454
Optional: true,
5555
Type: schema.TypeInt,
56-
Description: "The total number of connections per shard.If read-only replicas are not enabled, the lower limit is 10,000 and the upper limit is 40,000.When you enable read-only replicas, the minimum limit is 10,000 and the upper limit is 10,000 × (the number of read replicas +3).",
57-
},
58-
59-
"bandwidth": {
60-
Optional: true,
61-
Type: schema.TypeInt,
62-
Deprecated: "Configure `add_bandwidth` instead. This attribute will be removed in the next major version of the provider",
63-
Description: "Additional bandwidth, greater than 0, in MB.",
56+
Description: "The total number of connections per shard.If read-only replicas are not enabled, the lower limit is 10,000 and the upper limit is 40,000.When you enable read-only replicas, the minimum limit is 10,000 and the upper limit is 10,000 * (the number of read replicas +3).",
6457
},
6558

6659
"total_bandwidth": {
@@ -193,11 +186,6 @@ func resourceTencentCloudRedisConnectionConfigUpdate(d *schema.ResourceData, met
193186
request.ClientLimit = helper.IntInt64(v.(int))
194187
}
195188

196-
// bandwidth is about to be deprecated, use the add_bandwidth attribute
197-
if v, ok := d.GetOkExists("bandwidth"); ok {
198-
request.Bandwidth = helper.IntInt64(v.(int))
199-
}
200-
201189
if v, ok := d.GetOkExists("add_bandwidth"); ok {
202190
request.Bandwidth = helper.IntInt64(v.(int))
203191
}

website/docs/d/mysql_parameter_list.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data "tencentcloud_mysql_parameter_list" "mysql" {
2525

2626
The following arguments are supported:
2727

28-
* `engine_version` - (Optional, String) The version number of the database engine to use. Supported versions include 5.5/5.6/5.7.
28+
* `engine_version` - (Optional, String) The version number of the database engine to use. Supported versions include 5.5/5.6/5.7/8.0.
2929
* `mysql_id` - (Optional, String) Instance ID.
3030
* `result_output_file` - (Optional, String) Used to store results.
3131

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
subcategory: "TencentDB for Redis(crs)"
3+
layout: "tencentcloud"
4+
page_title: "TencentCloud: tencentcloud_redis_connection_config"
5+
sidebar_current: "docs-tencentcloud-resource-redis_connection_config"
6+
description: |-
7+
Provides a resource to create a redis connection_config
8+
---
9+
10+
# tencentcloud_redis_connection_config
11+
12+
Provides a resource to create a redis connection_config
13+
14+
## Example Usage
15+
16+
```hcl
17+
resource "tencentcloud_redis_connection_config" "connection_config" {
18+
instance_id = "crs-fhm9fnv1"
19+
client_limit = "20000"
20+
add_bandwidth = "30"
21+
}
22+
```
23+
24+
## Argument Reference
25+
26+
The following arguments are supported:
27+
28+
* `instance_id` - (Required, String) The ID of instance.
29+
* `add_bandwidth` - (Optional, Int) Refers to the additional bandwidth of the instance. When the standard bandwidth does not meet the demand, the user can increase the bandwidth by himself. When the read-only copy is enabled, the total bandwidth of the instance = additional bandwidth * number of fragments + standard bandwidth * number of fragments * Max ([number of read-only replicas, 1] ), the number of shards in the standard architecture = 1, and when read-only replicas are not enabled, the total bandwidth of the instance = additional bandwidth * number of shards + standard bandwidth * number of shards, and the number of shards in the standard architecture = 1.
30+
* `client_limit` - (Optional, Int) The total number of connections per shard.If read-only replicas are not enabled, the lower limit is 10,000 and the upper limit is 40,000.When you enable read-only replicas, the minimum limit is 10,000 and the upper limit is 10,000 * (the number of read replicas +3).
31+
32+
## Attributes Reference
33+
34+
In addition to all arguments above, the following attributes are exported:
35+
36+
* `id` - ID of the resource.
37+
* `base_bandwidth` - standard bandwidth. Refers to the bandwidth allocated by the system to each node when an instance is purchased.
38+
* `max_add_bandwidth` - Additional bandwidth is capped.
39+
* `min_add_bandwidth` - Additional bandwidth sets the lower limit.
40+
* `total_bandwidth` - Total bandwidth of the instance = additional bandwidth * number of shards + standard bandwidth * number of shards * (number of primary nodes + number of read-only replica nodes), the number of shards of the standard architecture = 1, in Mb/s.
41+
42+
43+
## Import
44+
45+
Redis connectionConfig can be imported, e.g.
46+
47+
```
48+
$ terraform import tencentcloud_redis_connection_config.connection_config instance_id
49+
```
50+

website/tencentcloud.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4260,6 +4260,9 @@
42604260
<li>
42614261
<a href="/docs/providers/tencentcloud/r/redis_clear_instance_operation.html">tencentcloud_redis_clear_instance_operation</a>
42624262
</li>
4263+
<li>
4264+
<a href="/docs/providers/tencentcloud/r/redis_connection_config.html">tencentcloud_redis_connection_config</a>
4265+
</li>
42634266
<li>
42644267
<a href="/docs/providers/tencentcloud/r/redis_instance.html">tencentcloud_redis_instance</a>
42654268
</li>

0 commit comments

Comments
 (0)