Skip to content

Commit e170bd9

Browse files
authored
Merge pull request #439 from Himer/master
tcaplus change field name and des.
2 parents 048a136 + 03c346c commit e170bd9

Some content is hidden

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

42 files changed

+513
-756
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ DEPRECATED:
1919
* Data Source: `tencentcloud_mysql_instances`: optional argument `pay_type` is no longer supported, replace by `charge_type`.
2020
* Resource: `tencentcloud_mysql_instance`: optional arguments `pay_type` and `period` are no longer supported, replace by `charge_type` and `prepaid_period`.
2121
* Resource: `tencentcloud_mysql_readonly_instance`: optional arguments `pay_type` and `period` are no longer supported, replace by `charge_type` and `prepaid_period`.
22+
* Resource: `tencentcloud_tcaplus_group` replace by `tencentcloud_tcaplus_tablegroup`
23+
* Data Source: `tencentcloud_tcaplus_groups` replace by `tencentcloud_tcaplus_tablegroups`
24+
* Resource: `tencentcloud_tcaplus_tablegroup`,`tencentcloud_tcaplus_idl` and `tencentcloud_tcaplus_table` arguments `group_id`/`group_name` replace by `tablegroup_id`/`tablegroup_name`
25+
* Data Source: `tencentcloud_tcaplus_groups`,`tencentcloud_tcaplus_idls` and `tencentcloud_tcaplus_tables` arguments `group_id`/`group_name` replace by `tablegroup_id`/`tablegroup_name`
2226

2327
## 1.35.1 (June 02, 2020)
2428

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1-
resource "tencentcloud_vpc" "foo" {
2-
name = var.instance_name
3-
cidr_block = var.vpc_cidr
4-
}
5-
6-
resource "tencentcloud_subnet" "subnet" {
7-
name = var.instance_name
8-
vpc_id = tencentcloud_vpc.foo.id
1+
data "tencentcloud_vpc_subnets" "vpc" {
2+
is_default = true
93
availability_zone = var.availability_zone
10-
cidr_block = var.subnet_cidr
11-
is_multicast = false
124
}
135

14-
resource "tencentcloud_tcaplus_application" "test_app" {
6+
resource "tencentcloud_tcaplus_cluster" "test_cluster" {
157
idl_type = "PROTO"
16-
app_name = "tf_tcaplus_g_table"
17-
vpc_id = tencentcloud_vpc.foo.id
18-
subnet_id = tencentcloud_subnet.subnet.id
8+
cluster_name = "tf_tcaplus_g_table"
9+
vpc_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.vpc_id
10+
subnet_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.subnet_id
1911
password = "1qaA2k1wgvfa3ZZZ"
2012
old_password_expire_last = 3600
2113
}
2214

2315
resource "tencentcloud_tcaplus_idl" "test_idl" {
24-
app_id = tencentcloud_tcaplus_application.test_app.id
25-
zone_id = tencentcloud_tcaplus_zone.test_zone.id
16+
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
17+
tablegroup_id = tencentcloud_tcaplus_tablegroup.test_tablegroup.id
2618
file_name = "tf_idl_test_guagua"
2719
file_type = "PROTO"
2820
file_ext_type = "proto"
@@ -55,20 +47,20 @@ resource "tencentcloud_tcaplus_idl" "test_idl" {
5547
EOF
5648
}
5749

58-
resource "tencentcloud_tcaplus_zone" "test_zone" {
59-
app_id = tencentcloud_tcaplus_application.test_app.id
60-
zone_name = "tf_test_zone_name_guagua"
50+
resource "tencentcloud_tcaplus_tablegroup" "test_tablegroup" {
51+
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
52+
tablegroup_name = "tf_test_tablegroup"
6153
}
6254

6355
resource "tencentcloud_tcaplus_table" "test_table" {
64-
app_id = tencentcloud_tcaplus_application.test_app.id
65-
zone_id = tencentcloud_tcaplus_zone.test_zone.id
66-
table_name = "tb_online_guagua"
67-
table_type = "GENERIC"
68-
description = "test"
69-
idl_id = tencentcloud_tcaplus_idl.test_idl.id
70-
table_idl_type = "PROTO"
71-
reserved_read_qps = 1000
72-
reserved_write_qps = 20
73-
reserved_volume = 1
56+
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
57+
tablegroup_id = tencentcloud_tcaplus_tablegroup.test_tablegroup.id
58+
table_name = "tb_online_guagua"
59+
table_type = "GENERIC"
60+
description = "test"
61+
idl_id = tencentcloud_tcaplus_idl.test_idl.id
62+
table_idl_type = "PROTO"
63+
reserved_read_cu = 1000
64+
reserved_write_cu = 20
65+
reserved_volume = 1
7466
}
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
variable "availability_zone" {
22
default = "ap-shanghai-2"
3-
}
4-
variable "instance_name" {
5-
default = "vpc_test"
6-
}
7-
variable "vpc_cidr" {
8-
default = "10.1.0.0/16"
9-
}
10-
variable "subnet_cidr" {
11-
default = "10.1.1.0/24"
12-
}
3+
}

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"github.com/hashicorp/terraform-plugin-sdk/plugin"
55
"github.com/hashicorp/terraform-plugin-sdk/terraform"
6-
76
"github.com/terraform-providers/terraform-provider-tencentcloud/tencentcloud"
87
)
98

tencentcloud/data_source_tc_tcaplus_clusters.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
3-
Use this data source to query tcaplus clusters
3+
Use this data source to query TcaplusDB clusters.
44
55
Example Usage
66
@@ -33,88 +33,88 @@ func dataSourceTencentCloudTcaplusClusters() *schema.Resource {
3333
"cluster_name": {
3434
Type: schema.TypeString,
3535
Optional: true,
36-
Description: "Name of the tcaplus cluster to be query.",
36+
Description: "Name of the TcaplusDB cluster to be query.",
3737
},
3838
"cluster_id": {
3939
Type: schema.TypeString,
4040
Optional: true,
41-
Description: "Id of the tcaplus cluster to be query.",
41+
Description: "Id of the TcaplusDB cluster to be query.",
4242
},
4343
"result_output_file": {
4444
Type: schema.TypeString,
4545
Optional: true,
46-
Description: "Used to save results.",
46+
Description: "File for saving results.",
4747
},
4848
"list": {
4949
Type: schema.TypeList,
5050
Computed: true,
51-
Description: "A list of tcaplus cluster. Each element contains the following attributes.",
51+
Description: "A list of TcaplusDB cluster. Each element contains the following attributes.",
5252
Elem: &schema.Resource{
5353
Schema: map[string]*schema.Schema{
5454
"cluster_name": {
5555
Type: schema.TypeString,
5656
Computed: true,
57-
Description: "Name of the tcaplus cluster.",
57+
Description: "Name of the TcaplusDB cluster.",
5858
},
5959
"cluster_id": {
6060
Type: schema.TypeString,
6161
Computed: true,
62-
Description: "Id of the tcaplus cluster.",
62+
Description: "Id of the TcaplusDB cluster.",
6363
},
6464
"idl_type": {
6565
Type: schema.TypeString,
6666
Computed: true,
67-
Description: "Idl type of the tcaplus cluster.",
67+
Description: "IDL type of the TcaplusDB cluster.",
6868
},
6969
"vpc_id": {
7070
Type: schema.TypeString,
7171
Computed: true,
72-
Description: "VPC id of the tcaplus cluster.",
72+
Description: "VPC id of the TcaplusDB cluster.",
7373
},
7474
"subnet_id": {
7575
Type: schema.TypeString,
7676
Computed: true,
77-
Description: "Subnet id of the tcaplus cluster.",
77+
Description: "Subnet id of the TcaplusDB cluster.",
7878
},
7979
"password": {
8080
Type: schema.TypeString,
8181
Computed: true,
82-
Description: "Password of the tcaplus cluster.",
82+
Description: "Access password of the TcaplusDB cluster.",
8383
},
8484
"network_type": {
8585
Type: schema.TypeString,
8686
Computed: true,
87-
Description: "Network type of the tcaplus cluster.",
87+
Description: "Network type of the TcaplusDB cluster.",
8888
},
8989
"create_time": {
9090
Type: schema.TypeString,
9191
Computed: true,
92-
Description: "Create time of the tcaplus cluster.",
92+
Description: "Create time of the TcaplusDB cluster.",
9393
},
9494
"password_status": {
9595
Type: schema.TypeString,
9696
Computed: true,
97-
Description: "Password status of the tcaplus cluster.`unmodifiable` means:can not change password now,`modifiable` means:can change password now.",
97+
Description: "Password status of the TcaplusDB cluster. Valid values: `unmodifiable`, which means the password can not be changed in this moment; `modifiable`, which means the password can be changed in this moment.",
9898
},
9999
"api_access_id": {
100100
Type: schema.TypeString,
101101
Computed: true,
102-
Description: "Access id of the tcaplus cluster.For TcaplusDB SDK connect.",
102+
Description: "Access id of the TcaplusDB cluster.For TcaplusDB SDK connect.",
103103
},
104104
"api_access_ip": {
105105
Type: schema.TypeString,
106106
Computed: true,
107-
Description: "Access ip of the tcaplus cluster.For TcaplusDB SDK connect.",
107+
Description: "Access ip of the TcaplusDB cluster.For TcaplusDB SDK connect.",
108108
},
109109
"api_access_port": {
110110
Type: schema.TypeInt,
111111
Computed: true,
112-
Description: "Access port of the tcaplus cluster.For TcaplusDB SDK connect.",
112+
Description: "Access port of the TcaplusDB cluster.For TcaplusDB SDK connect.",
113113
},
114114
"old_password_expire_time": {
115115
Type: schema.TypeString,
116116
Computed: true,
117-
Description: "This field will display the old password expiration time,if password_status is `unmodifiable` means the old password has not yet expired, otherwise `-`.",
117+
Description: "Expiration time of the old password. If `password_status` is `unmodifiable`, it means the old password has not yet expired.",
118118
},
119119
},
120120
},

tencentcloud/data_source_tc_tcaplus_idls.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Use this data source to query tcaplus idl files
2+
Use this data source to query IDL information of the TcaplusDB table.
33
44
Example Usage
55
@@ -27,23 +27,23 @@ func dataSourceTencentCloudTcaplusIdls() *schema.Resource {
2727
"cluster_id": {
2828
Type: schema.TypeString,
2929
Required: true,
30-
Description: "Id of the tcaplus cluster to be query.",
30+
Description: "Id of the TcaplusDB cluster to be query.",
3131
},
3232
"result_output_file": {
3333
Type: schema.TypeString,
3434
Optional: true,
35-
Description: "Used to save results.",
35+
Description: "File for saving results.",
3636
},
3737
"list": {
3838
Type: schema.TypeList,
3939
Computed: true,
40-
Description: "A list of tcaplus idls. Each element contains the following attributes.",
40+
Description: "A list of TcaplusDB table IDL. Each element contains the following attributes.",
4141
Elem: &schema.Resource{
4242
Schema: map[string]*schema.Schema{
4343
"idl_id": {
4444
Type: schema.TypeString,
4545
Computed: true,
46-
Description: "Id of this idl.",
46+
Description: "Id of the IDL.",
4747
},
4848
},
4949
},

tencentcloud/data_source_tc_tcaplus_idls_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ data "tencentcloud_vpc_subnets" "vpc" {
3636
availability_zone = var.availability_zone
3737
}
3838
39-
resource "tencentcloud_tcaplus_group" "test_group" {
40-
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
41-
group_name = "tf_test_group_name_guagua"
39+
resource "tencentcloud_tcaplus_tablegroup" "test_group" {
40+
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
41+
tablegroup_name = "tf_test_group_name_guagua"
4242
}
4343
4444
resource "tencentcloud_tcaplus_cluster" "test_cluster" {
@@ -51,7 +51,7 @@ resource "tencentcloud_tcaplus_cluster" "test_cluster" {
5151
}
5252
resource "tencentcloud_tcaplus_idl" "test_idl" {
5353
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
54-
group_id = tencentcloud_tcaplus_group.test_group.id
54+
tablegroup_id = tencentcloud_tcaplus_tablegroup.test_group.id
5555
file_name = "tf_idl_test_guagua"
5656
file_type = "PROTO"
5757
file_ext_type = "proto"

0 commit comments

Comments
 (0)