diff --git a/.changelog/2647.txt b/.changelog/2647.txt new file mode 100644 index 0000000000..4cf50226a1 --- /dev/null +++ b/.changelog/2647.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +tencentcloud_mysql_dr_instance: modify doc +``` diff --git a/.github/workflows/tfprovider-lint.yml b/.github/workflows/tfprovider-lint.yml index 0853b5c668..01dc544175 100644 --- a/.github/workflows/tfprovider-lint.yml +++ b/.github/workflows/tfprovider-lint.yml @@ -28,7 +28,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version: 1.18.1 + cache: false - name: install tfproviderlint run: cd .ci/tools && go install github.com/bflad/tfproviderlint/cmd/tfproviderlint diff --git a/tencentcloud/services/cdb/resource_tc_mysql_dr_instance.md b/tencentcloud/services/cdb/resource_tc_mysql_dr_instance.md index 42e59fd14f..3b7b767a8b 100644 --- a/tencentcloud/services/cdb/resource_tc_mysql_dr_instance.md +++ b/tencentcloud/services/cdb/resource_tc_mysql_dr_instance.md @@ -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 ``` \ No newline at end of file diff --git a/website/docs/d/gaap_real_servers_status.html.markdown b/website/docs/d/gaap_real_servers_status.html.markdown index 77055e1c47..8b1ac82a8d 100644 --- a/website/docs/d/gaap_real_servers_status.html.markdown +++ b/website/docs/d/gaap_real_servers_status.html.markdown @@ -15,7 +15,7 @@ Use this data source to query detailed information of gaap real servers status ```hcl data "tencentcloud_gaap_real_servers_status" "real_servers_status" { - real_server_ids = ["rs-qcygnwpd"] + real_server_ids = ["rs-3mlpbuut"] } ``` diff --git a/website/docs/r/mysql_dr_instance.html.markdown b/website/docs/r/mysql_dr_instance.html.markdown index 0fc9a40051..91511cde87 100644 --- a/website/docs/r/mysql_dr_instance.html.markdown +++ b/website/docs/r/mysql_dr_instance.html.markdown @@ -11,72 +11,33 @@ description: |- 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" } } ``` @@ -120,8 +81,8 @@ In addition to all arguments above, the following attributes are exported: ## 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 ```