-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2647 from tencentcloudstack/fix/cdb-dr-doc
docs(cdb): [117594777]modify dr instance doc
- Loading branch information
Showing
5 changed files
with
56 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
tencentcloud_mysql_dr_instance: modify doc | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 25 additions & 64 deletions
89
tencentcloud/services/cdb/resource_tc_mysql_dr_instance.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,38 @@ | ||
Provides a mysql instance resource to create read-only database instances. | ||
|
||
~> **NOTE:** Read-only instances can be purchased only for two-node or three-node source instances on MySQL 5.6 or above with the InnoDB engine at a specification of 1 GB memory and 50 GB disk capacity or above. | ||
~> **NOTE:** The terminate operation of read only mysql does NOT take effect immediately, maybe takes for several hours. so during that time, VPCs associated with that mysql instance can't be terminated also. | ||
|
||
Example Usage | ||
|
||
```hcl | ||
data "tencentcloud_availability_zones_by_product" "zones" { | ||
product = "cdb" | ||
} | ||
resource "tencentcloud_vpc" "vpc" { | ||
name = "vpc-mysql" | ||
cidr_block = "10.0.0.0/16" | ||
} | ||
resource "tencentcloud_subnet" "subnet" { | ||
availability_zone = data.tencentcloud_availability_zones_by_product.zones.zones.0.name | ||
name = "subnet-mysql" | ||
vpc_id = tencentcloud_vpc.vpc.id | ||
cidr_block = "10.0.0.0/16" | ||
is_multicast = false | ||
} | ||
resource "tencentcloud_security_group" "security_group" { | ||
name = "sg-mysql" | ||
description = "mysql test" | ||
} | ||
resource "tencentcloud_mysql_instance" "example" { | ||
internet_service = 1 | ||
engine_version = "5.7" | ||
charge_type = "POSTPAID" | ||
root_password = "PassWord123" | ||
slave_deploy_mode = 0 | ||
availability_zone = data.tencentcloud_availability_zones_by_product.zones.zones.0.name | ||
slave_sync_mode = 1 | ||
instance_name = "tf-example-mysql" | ||
mem_size = 4000 | ||
volume_size = 200 | ||
vpc_id = tencentcloud_vpc.vpc.id | ||
subnet_id = tencentcloud_subnet.subnet.id | ||
intranet_port = 3306 | ||
security_groups = [tencentcloud_security_group.security_group.id] | ||
tags = { | ||
name = "test" | ||
} | ||
parameters = { | ||
character_set_server = "UTF8" | ||
max_connections = "1000" | ||
} | ||
} | ||
resource "tencentcloud_mysql_readonly_instance" "example" { | ||
master_instance_id = tencentcloud_mysql_instance.example.id | ||
instance_name = "tf-example" | ||
mem_size = 128000 | ||
volume_size = 255 | ||
vpc_id = tencentcloud_vpc.vpc.id | ||
subnet_id = tencentcloud_subnet.subnet.id | ||
intranet_port = 3306 | ||
security_groups = [tencentcloud_security_group.security_group.id] | ||
resource "tencentcloud_mysql_dr_instance" "mysql_dr" { | ||
master_instance_id = "cdb-adjdu3t5" | ||
master_region = "ap-guangzhou" | ||
auto_renew_flag = 0 | ||
availability_zone = "ap-shanghai-3" | ||
charge_type = "POSTPAID" | ||
cpu = 4 | ||
device_type = "UNIVERSAL" | ||
first_slave_zone = "ap-shanghai-4" | ||
instance_name = "mysql-dr-test-up" | ||
mem_size = 8000 | ||
prepaid_period = 1 | ||
project_id = 0 | ||
security_groups = [ | ||
"sg-q4d821qk", | ||
] | ||
slave_deploy_mode = 1 | ||
slave_sync_mode = 0 | ||
subnet_id = "subnet-5vfntba5" | ||
volume_size = 100 | ||
vpc_id = "vpc-h6s1s3aa" | ||
intranet_port = 3360 | ||
tags = { | ||
createBy = "terraform" | ||
test = "test-tf" | ||
} | ||
} | ||
``` | ||
Import | ||
|
||
mysql read-only database instances can be imported using the id, e.g. | ||
mysql dr database instances can be imported using the id, e.g. | ||
``` | ||
terraform import tencentcloud_mysql_readonly_instance.default cdb-dnqksd9f | ||
terraform import tencentcloud_mysql_dr_instance.mysql_dr cdb-bcet7sdb | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters