Skip to content

Commit

Permalink
docs(rds): fix docs issues. (FlexibleEngineCloud#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zippo-Wang authored and Zhukun-Huawei committed Nov 20, 2023
1 parent 5e85266 commit b7279eb
Show file tree
Hide file tree
Showing 10 changed files with 212 additions and 117 deletions.
15 changes: 13 additions & 2 deletions docs/data-sources/rds_flavors_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ data "flexibleengine_rds_flavors_v3" "flavor" {

## Argument Reference

* `region` - (Optional, String) The region in which to query the data source. If omitted, the provider-level region
will be used.

* `db_type` - (Required, String) Specifies the DB engine. Value: MySQL, PostgreSQL, SQLServer.

* `db_version` - (Required, String) Specifies the database version. MySQL databases support MySQL 5.6
Expand All @@ -42,21 +45,29 @@ data "flexibleengine_rds_flavors_v3" "flavor" {

* `availability_zone` - (Optional, String) Specifies the availability zone which the RDS flavor belongs to.

## Attributes Reference
## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The data source ID.

* `flavors` - Indicates the flavors information. Structure is documented below.
* `flavors` - Indicates the flavors information. The [flavors](#rds_flavors) object structure is documented below.

<a name="rds_flavors"></a>
The `flavors` block contains:

* `id` - The ID of the rds flavor.

* `name` - The name of the rds flavor.

* `vcpus` - The CPU size.

* `memory` - The memory size in GB.

* `group_type` - The performance specification.

* `instance_mode` - The mode of instance.

* `availability_zones` - The availability zones which the RDS flavor belongs to.

* `db_versions` - The Available versions of the database.
14 changes: 11 additions & 3 deletions docs/resources/rds_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ resource "flexibleengine_rds_account" "test" {

The following arguments are supported:

* `region` - (Optional, String, ForceNew) The region in which to create the rds account resource. If omitted, the
provider-level region will be used. Changing this creates a new resource.
* `region` - (Optional, String, ForceNew) Specifies the region in which to create the RDS account resource.
If omitted, the provider-level region will be used. Changing this will create a new RDS account resource.

* `instance_id` - (Required, String, ForceNew) Specifies the rds instance id. Changing this will create a new resource.

Expand All @@ -38,12 +38,20 @@ The following arguments are supported:
long and contain only letters(case-sensitive), digits, and special characters(~!@#$%^*-_=+?,()&). The value must be
different from name or name spelled backwards.

## Attributes Reference
## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The resource ID of account which is formatted `<instance_id>/<account_name>`.

## Timeouts

This resource provides the following timeouts configuration options:

* `create` - Default is 10 minutes.
* `update` - Default is 10 minutes.
* `delete` - Default is 10 minutes.

## Import

RDS account can be imported using the `instance id` and `account name`, e.g.:
Expand Down
18 changes: 15 additions & 3 deletions docs/resources/rds_database.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ resource "flexibleengine_rds_database" "test" {

The following arguments are supported:

* `region` - (Optional, String, ForceNew) The region in which to create the RDS database resource. If omitted, the
provider-level region will be used. Changing this creates a new resource.
* `region` - (Optional, String, ForceNew) Specifies the region in which to create the RDS database resource.
If omitted, the provider-level region will be used. Changing this will create a new RDS database resource.

* `instance_id` - (Required, String, ForceNew) Specifies the RDS instance ID. Changing this will create a new resource.

Expand All @@ -37,12 +37,24 @@ The following arguments are supported:
* `character_set` - (Required, String, ForceNew) Specifies the character set used by the database, For example **utf8**,
**gbk**, **ascii**, etc. Changing this will create a new resource.

## Attributes Reference
* `description` - (Optional, String) Specifies the database description. The value can contain **0** to **512**
characters. This parameter takes effect only for DB instances whose kernel versions are at least **5.6.51.3**,
**5.7.33.1**, or **8.0.21.4**.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The resource ID of database which is formatted `<instance_id>/<database_name>`.

## Timeouts

This resource provides the following timeouts configuration options:

* `create` - Default is 10 minutes.
* `update` - Default is 10 minutes.
* `delete` - Default is 10 minutes.

## Import

RDS database can be imported using the `instance id` and `database name`, e.g.
Expand Down
26 changes: 18 additions & 8 deletions docs/resources/rds_database_privilege.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,42 @@ resource "flexibleengine_rds_database_privilege" "test" {

The following arguments are supported:

* `region` - (Optional, String, ForceNew) The region in which to create the RDS database privilege resource. If omitted,
the provider-level region will be used. Changing this creates a new resource.
* `region` - (Optional, String, ForceNew) Specifies the region in which to create the RDS database privilege resource.
If omitted, the provider-level region will be used. Changing this will create a new RDS database privilege resource.

* `instance_id` - (Required, String, ForceNew) Specifies the RDS instance ID. Changing this will create a new resource.

* `db_name` - (Required, String, ForceNew) Specifies the database name. Changing this creates a new resource.

* `users` - (Required, String, ForceNew) Specifies the account that associated with the database. This parameter supports
a maximum of 50 elements. Structure is documented below. Changing this creates a new resource.
* `users` - (Required, List, ForceNew) Specifies the account that associated with the database. This parameter supports
a maximum of 50 elements. The [users](#rds_users) object structure is documented below.
Changing this creates a new resource.

<a name="rds_users"></a>
The `users` block supports:

* `name` - (Required, String, ForceNew) Specifies the username of the database account. Changing this creates a new resource.
* `name` - (Required, String) Specifies the username of the database account.

* `readonly` - (Optional, Bool, ForceNew) Specifies the read-only permission. The value can be:
* `readonly` - (Optional, Bool) Specifies the read-only permission. The value can be:
+ **true**: indicates the read-only permission.
+ **false**: indicates the read and write permission.

The default value is **false**. Changing this creates a new resource.
The default value is **false**.

## Attributes Reference
## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The resource ID of database privilege which is formatted `<instance_id>/<database_name>`.

## Timeouts

This resource provides the following timeouts configuration options:

* `create` - Default is 30 minutes.
* `update` - Default is 30 minutes.
* `delete` - Default is 30 minutes.

## Import

RDS database privilege can be imported using the `instance id` and `database name`, e.g.
Expand Down
75 changes: 48 additions & 27 deletions docs/resources/rds_instance_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ resource "flexibleengine_rds_instance_v3" "instance" {

The following arguments are supported:

* `region` - (Optional, String, ForceNew) Specifies the region in which to create the RDS instance resource.
If omitted, the provider-level region will be used. Changing this will create a new RDS instance resource.

* `name` - (Required, String) Specifies the DB instance name. The DB instance name of the same type must be unique for
the same tenant. The value must be 4 to 64 characters in length and start with a letter. It is case-sensitive and can
contain only letters, digits, hyphens (-), and underscores (_).
Expand All @@ -167,8 +170,8 @@ The following arguments are supported:
* `availability_zone` - (Required, List, ForceNew) Specifies the list of AZ name.
Changing this parameter will create a new resource.

* `db` - (Required, String, ForceNew) Specifies the database information. Structure is documented below.
Changing this parameter will create a new resource.
* `db` - (Required, List, ForceNew) Specifies the database information. The [db](#rds_db) object structure is
documented below. Changing this parameter will create a new resource.

* `vpc_id` - (Required, String, ForceNew) Specifies the VPC ID. Changing this parameter will create a new resource.

Expand All @@ -177,12 +180,13 @@ The following arguments are supported:

* `security_group_id` - (Required, String) Specifies the security group which the RDS DB instance belongs to.

* `volume` - (Required, List) Specifies the volume information. Structure is documented below.
* `volume` - (Required, List) Specifies the volume information. The [volume](#rds_volume) object structure is
documented below.

* `fixed_ip` - (Optional, String, ForceNew) Specifies an intranet IP address of RDS DB instance.
Changing this parameter will create a new resource.
* `fixed_ip` - (Optional, String) Specifies an intranet IP address of RDS DB instance.

* `backup_strategy` - (Optional, List) Specifies the advanced backup policy. Structure is documented below.
* `backup_strategy` - (Optional, List) Specifies the advanced backup policy. The [backup_strategy](#rds_backup_strategy)
object structure is documented below.

* `ha_replication_mode` - (Optional, String, ForceNew) Specifies the replication mode for the standby DB instance.
Changing this parameter will create a new resource.
Expand All @@ -204,6 +208,11 @@ The following arguments are supported:
* `tags` - (Optional, Map) A mapping of tags to assign to the RDS instance.
Each tag is represented by one key-value pair.

* `parameters` - (Optional, List) Specify an array of one or more parameters to be set to the RDS instance after
launched. You can check on console to see which parameters supported. The [parameters](#rds_parameters) object
structure is documented below.

<a name="rds_db"></a>
The `db` block supports:

* `type` - (Required, String, ForceNew) Specifies the DB engine. Available value are *MySQL*, *PostgreSQL* and
Expand All @@ -215,20 +224,19 @@ The `db` block supports:
databases support 2014 SE and 2014 EE, example values: "2014_SE", "2014_EE".
Changing this parameter will create a new resource.

* `password` - (Required, String, ForceNew) Specifies the database password. The value cannot be
empty and should contain 8 to 32 characters, including uppercase
and lowercase letters, digits, and the following special
characters: ~!@#%^*-_=+? You are advised to enter a strong
password to improve security, preventing security risks such as
brute force cracking. Changing this parameter will create a new resource.
* `password` - (Required, String) Specifies the database password. The value cannot be
empty and should contain 8 to 32 characters, including uppercase and lowercase letters, digits, and the following
special characters: ~!@#%^*-_=+? You are advised to enter a strong password to improve security, preventing security
risks such as brute force cracking.

* `port` - (Optional, Int) Specifies the database port.
+ The MySQL database port ranges from 1024 to 65535 (excluding 12017 and 33071, which are occupied by the RDS system
and cannot be used). The default value is 3306.
+ The PostgreSQL database port ranges from 2100 to 9500. The default value is 5432.
+ The Microsoft SQL Server database port can be 1433 or ranges from 2100 to 9500, excluding 5355 and 5985.
The default value is 1433.
The default value is 1433.

<a name="rds_volume"></a>
The `volume` block supports:

* `size` - (Required, Int) Specifies the volume size. Its value range is from 40 GB to 4000 GB.
Expand All @@ -241,9 +249,10 @@ The `volume` block supports:

Changing this parameter will create a new resource.

* `disk_encryption_id` - (Optional, String) Specifies the key ID for disk encryption.
* `disk_encryption_id` - (Optional, String, ForceNew) Specifies the key ID for disk encryption.
Changing this parameter will create a new resource.

<a name="rds_backup_strategy"></a>
The `backup_strategy` block supports:

* `keep_days` - (Optional, Int) Specifies the retention days for specific backup files. The value range is from 0 to
Expand All @@ -253,12 +262,19 @@ The `backup_strategy` block supports:
policy.

* `start_time` - (Required, String) Specifies the backup time window. Automated backups will be triggered during the
backup time window. It must be a valid value in the **hh:mm-HH:MM**
format. The current time is in the UTC format. The HH value must be 1 greater than the hh value. The values of mm and
MM must be the same and must be set to any of the following: 00, 15, 30, or 45. Example value: 08:15-09:15 23:00-00:
00.
backup time window. It must be a valid value in the **hh:mm-HH:MM** format. The current time is in the UTC format.
The HH value must be 1 greater than the hh value. The values of mm and MM must be the same and must be set to any
of the following: 00, 15, 30, or 45. Example value: 08:15-09:15 23:00-00:00.

<a name="rds_parameters"></a>
The `parameters` block supports:

* `name` - (Required, String) Specifies the parameter name. Some of them needs the instance to be restarted
to take effect.

## Attributes Reference
* `value` - (Required, String) Specifies the parameter value.

## Attribute Reference

In addition to the arguments listed above, the following computed attributes are exported:

Expand All @@ -268,18 +284,17 @@ In addition to the arguments listed above, the following computed attributes are

* `created` - Indicates the creation time.

* `nodes` - Indicates the instance nodes information. Structure is documented below.
* `nodes` - Indicates the instance nodes information. The [nodes](#rds_attr_nodes) object structure is documented below.

* `private_ips` - Indicates the private IP address list.
It is a blank string until an ECS is created.

* `public_ips` - Indicates the public IP address list.

* `db` - See Argument Reference above. The `db` block also contains:

+ `user_name` - Indicates the default user name of database.
* `db` - See Argument Reference above. The [db](#rds_attr_db) object structure is documented below.

The `nodes` block contains:
<a name="rds_attr_nodes"></a>
The `nodes` block supports:

* `availability_zone` - Indicates the AZ.

Expand All @@ -292,12 +307,18 @@ The `nodes` block contains:

* `status` - Indicates the node status.

<a name="rds_attr_db"></a>
The `db` block supports:

* `user_name` - Indicates the default username of database.

## Timeouts

This resource provides the following timeouts configuration options:

* `create` - Default is 30 minute.
* `update` - Default is 30 minute.
* `create` - Default is 30 minutes.
* `update` - Default is 30 minutes.
* `delete` - Default is 30 minutes.

## Import

Expand All @@ -307,7 +328,7 @@ RDS instance can be imported using the `id`, e.g.
terraform import flexibleengine_rds_instance_v3.instance_1 7117d38e-4c8f-4624-a505-bd96b97d024c
```

But due to some attrubutes missing from the API response, it's required to ignore changes as below.
But due to some attributes missing from the API response, it's required to ignore changes as below.

```hcl
resource "flexibleengine_rds_instance_v3" "instance_1" {
Expand Down
Loading

0 comments on commit b7279eb

Please sign in to comment.