|
| 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 | + |
0 commit comments