Skip to content

Commit 7e0f746

Browse files
authored
Feat/sqlserver resource (#1942)
* feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource * feat/sqlserver-resource
1 parent dbc15e4 commit 7e0f746

File tree

5 files changed

+138
-4
lines changed

5 files changed

+138
-4
lines changed

.changelog/1942.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
tencentcloud_sqlserver_general_cloud_ro_instance
3+
```

tencentcloud/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ SQLServer
855855
tencentcloud_sqlserver_start_xevent
856856
tencentcloud_sqlserver_instance_tde
857857
tencentcloud_sqlserver_database_tde
858+
tencentcloud_sqlserver_general_cloud_ro_instance
858859
859860
SSL Certificates
860861
Data Source

tencentcloud/resource_tc_sqlserver_general_cloud_ro_instance.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ Provides a resource to create a sqlserver general_cloud_ro_instance
33
44
Example Usage
55
6-
If `read_only_group_type` is 1:
6+
If read_only_group_type value is 1 - Ship according to one instance and one read-only group:
77
8+
```hcl
89
resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_instance" {
910
instance_id = "mssql-gyg9xycl"
1011
zone = "ap-guangzhou-6"
@@ -24,8 +25,9 @@ resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_in
2425
test-key2 = "test-value2"
2526
}
2627
}
28+
```
2729
28-
If `read_only_group_type` is 2:
30+
If read_only_group_type value is 2 - Ship after creating a read-only group, all instances are under this read-only group:
2931
3032
```hcl
3133
resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_instance" {
@@ -53,7 +55,7 @@ resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_in
5355
}
5456
```
5557
56-
If `read_only_group_type` is 3:
58+
If read_only_group_type value is 3 - All instances shipped are in the existing Some read-only groups below:
5759
5860
```hcl
5961
resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_instance" {
@@ -114,7 +116,7 @@ func resourceTencentCloudSqlserverGeneralCloudRoInstance() *schema.Resource {
114116
Required: true,
115117
Type: schema.TypeInt,
116118
ValidateFunc: validateIntegerInRange(1, 3),
117-
Description: "Read-only group type option, 1- Ship according to one instance and one read-only group, 2- Ship after creating a read-only group, all instances are under this read-only group, 3- All instances shipped are in the existing Some read-only groups below.",
119+
Description: "Read-only group type option, 1- Ship according to one instance and one read-only group, 2 - Ship after creating a read-only group, all instances are under this read-only group, 3 - All instances shipped are in the existing Some read-only groups below.",
118120
},
119121
"memory": {
120122
Required: true,
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
subcategory: "SQLServer"
3+
layout: "tencentcloud"
4+
page_title: "TencentCloud: tencentcloud_sqlserver_general_cloud_ro_instance"
5+
sidebar_current: "docs-tencentcloud-resource-sqlserver_general_cloud_ro_instance"
6+
description: |-
7+
Provides a resource to create a sqlserver general_cloud_ro_instance
8+
---
9+
10+
# tencentcloud_sqlserver_general_cloud_ro_instance
11+
12+
Provides a resource to create a sqlserver general_cloud_ro_instance
13+
14+
## Example Usage
15+
16+
### If read_only_group_type value is 1 - Ship according to one instance and one read-only group:
17+
18+
```hcl
19+
resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_instance" {
20+
instance_id = "mssql-gyg9xycl"
21+
zone = "ap-guangzhou-6"
22+
read_only_group_type = 1
23+
memory = 4
24+
storage = 100
25+
cpu = 2
26+
machine_type = "CLOUD_BSSD"
27+
instance_charge_type = "POSTPAID"
28+
subnet_id = "subnet-dwj7ipnc"
29+
vpc_id = "vpc-4owdpnwr"
30+
security_group_list = ["sg-7kpsbxdb"]
31+
collation = "Chinese_PRC_CI_AS"
32+
time_zone = "China Standard Time"
33+
resource_tags = {
34+
test-key1 = "test-value1"
35+
test-key2 = "test-value2"
36+
}
37+
}
38+
```
39+
40+
### If read_only_group_type value is 2 - Ship after creating a read-only group, all instances are under this read-only group:
41+
42+
```hcl
43+
resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_instance" {
44+
instance_id = "mssql-gyg9xycl"
45+
zone = "ap-guangzhou-6"
46+
read_only_group_type = 2
47+
read_only_group_name = "test-ro-group"
48+
read_only_group_is_offline_delay = 1
49+
read_only_group_max_delay_time = 10
50+
read_only_group_min_in_group = 1
51+
memory = 4
52+
storage = 100
53+
cpu = 2
54+
machine_type = "CLOUD_BSSD"
55+
instance_charge_type = "POSTPAID"
56+
subnet_id = "subnet-dwj7ipnc"
57+
vpc_id = "vpc-4owdpnwr"
58+
security_group_list = ["sg-7kpsbxdb"]
59+
collation = "Chinese_PRC_CI_AS"
60+
time_zone = "China Standard Time"
61+
resource_tags = {
62+
test-key1 = "test-value1"
63+
test-key2 = "test-value2"
64+
}
65+
}
66+
```
67+
68+
### If read_only_group_type value is 3 - All instances shipped are in the existing Some read-only groups below:
69+
70+
```hcl
71+
resource "tencentcloud_sqlserver_general_cloud_ro_instance" "general_cloud_ro_instance" {
72+
instance_id = "mssql-gyg9xycl"
73+
zone = "ap-guangzhou-6"
74+
read_only_group_type = 3
75+
memory = 4
76+
storage = 100
77+
cpu = 2
78+
machine_type = "CLOUD_BSSD"
79+
read_only_group_id = "mssqlrg-clboghrj"
80+
instance_charge_type = "POSTPAID"
81+
subnet_id = "subnet-dwj7ipnc"
82+
vpc_id = "vpc-4owdpnwr"
83+
security_group_list = ["sg-7kpsbxdb"]
84+
collation = "Chinese_PRC_CI_AS"
85+
time_zone = "China Standard Time"
86+
resource_tags = {
87+
test-key1 = "test-value1"
88+
test-key2 = "test-value2"
89+
}
90+
}
91+
```
92+
93+
## Argument Reference
94+
95+
The following arguments are supported:
96+
97+
* `cpu` - (Required, Int) Number of instance cores.
98+
* `instance_id` - (Required, String) Primary instance ID, in the format: mssql-3l3fgqn7.
99+
* `machine_type` - (Required, String) The host disk type of the purchased instance, CLOUD_HSSD-enhanced SSD cloud disk for virtual machines, CLOUD_TSSD-extremely fast SSD cloud disk for virtual machines, CLOUD_BSSD-universal SSD cloud disk for virtual machines.
100+
* `memory` - (Required, Int) Instance memory size, in GB.
101+
* `read_only_group_type` - (Required, Int) Read-only group type option, 1- Ship according to one instance and one read-only group, 2 - Ship after creating a read-only group, all instances are under this read-only group, 3 - All instances shipped are in the existing Some read-only groups below.
102+
* `storage` - (Required, Int) Instance disk size, in GB.
103+
* `zone` - (Required, String) Instance Availability Zone, similar to ap-guangzhou-1 (Guangzhou District 1); the instance sales area can be obtained through the interface DescribeZones.
104+
* `collation` - (Optional, String) System character set collation, default: Chinese_PRC_CI_AS.
105+
* `instance_charge_type` - (Optional, String) Payment mode, the value supports PREPAID (prepaid), POSTPAID (postpaid).
106+
* `period` - (Optional, Int) Purchase instance period, the default value is 1, which means one month. The value cannot exceed 48.
107+
* `read_only_group_id` - (Optional, String) Required when ReadOnlyGroupType=3, existing read-only group ID.
108+
* `read_only_group_is_offline_delay` - (Optional, Int) Required when ReadOnlyGroupType=2, whether to enable the delayed elimination function for the newly created read-only group, 1-on, 0-off. When the delay between the read-only replica and the primary instance is greater than the threshold, it will be automatically removed.
109+
* `read_only_group_max_delay_time` - (Optional, Int) Mandatory when ReadOnlyGroupType=2 and ReadOnlyGroupIsOfflineDelay=1, the threshold for delay culling of newly created read-only groups.
110+
* `read_only_group_min_in_group` - (Optional, Int) Required when ReadOnlyGroupType=2 and ReadOnlyGroupIsOfflineDelay=1, the newly created read-only group retains at least the number of read-only replicas after delay elimination.
111+
* `read_only_group_name` - (Optional, String) Required when ReadOnlyGroupType=2, the name of the newly created read-only group.
112+
* `resource_tags` - (Optional, Map) Tag description list.
113+
* `security_group_list` - (Optional, Set: [`String`]) Security group list, fill in the security group ID in the form of sg-xxx.
114+
* `subnet_id` - (Optional, String) VPC subnet ID, in the form of subnet-bdoe83fa; SubnetId and VpcId need to be set at the same time or not set at the same time.
115+
* `time_zone` - (Optional, String) System time zone, default: China Standard Time.
116+
* `vpc_id` - (Optional, String) VPC network ID, in the form of vpc-dsp338hz; SubnetId and VpcId need to be set at the same time or not set at the same time.
117+
118+
## Attributes Reference
119+
120+
In addition to all arguments above, the following attributes are exported:
121+
122+
* `id` - ID of the resource.
123+
* `ro_instance_id` - Primary read only instance ID, in the format: mssqlro-lbljc5qd.
124+
125+

website/tencentcloud.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,9 @@
21442144
<li>
21452145
<a href="/docs/providers/tencentcloud/r/sqlserver_general_cloud_instance.html">tencentcloud_sqlserver_general_cloud_instance</a>
21462146
</li>
2147+
<li>
2148+
<a href="/docs/providers/tencentcloud/r/sqlserver_general_cloud_ro_instance.html">tencentcloud_sqlserver_general_cloud_ro_instance</a>
2149+
</li>
21472150
<li>
21482151
<a href="/docs/providers/tencentcloud/r/sqlserver_general_communication.html">tencentcloud_sqlserver_general_communication</a>
21492152
</li>

0 commit comments

Comments
 (0)