Skip to content

Commit

Permalink
doc fixes & golangci-lint (#2798)
Browse files Browse the repository at this point in the history
[Doc] RDS: Update documentation examples and types

Summary of the Pull Request
Up-to-date documentation
PR Checklist

 Refers to: #xxx
 Tests added/passed.
 Documentation updated.
 Schema updated.
 Release notes added.

Reviewed-by: Anton Sidelnikov
  • Loading branch information
artem-lifshits authored Jan 23, 2025
1 parent 7e4aa0f commit 22f128b
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 57 deletions.
12 changes: 2 additions & 10 deletions docs/data-sources/rds_flavors_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Use this data source to get the ID of an available OpenTelekomCloud RDS flavor.
```hcl
data "opentelekomcloud_rds_flavors_v1" "flavor" {
datastore_name = "PostgreSQL"
datastore_version = "9.5.5"
speccode = "rds.pg.s1.medium"
datastore_version = "16"
speccode = "rds.pg.x1.xlarge.4"
}
```

Expand All @@ -33,14 +33,6 @@ data "opentelekomcloud_rds_flavors_v1" "flavor" {

* `speccode` - (Optional) The spec code of a rds flavor.

## Available value for attributes

| datastore_name | datastore_version | speccode |
|----------------|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| PostgreSQL | 9.5.5 <br> 9.6.3 <br> 9.6.5 | rds.pg.s1.xlarge rds.pg.m1.2xlarge rds.pg.c2.xlarge rds.pg.s1.medium rds.pg.c2.medium rds.pg.s1.large rds.pg.c2.large rds.pg.m1.large rds.pg.s1.2xlarge rds.pg.m1.xlarge |
| MySQL | 5.6.33 <br>5.6.30 <br>5.6.34 <br>5.6.35 <br>5.6.36 <br>5.7.17 <br>5.7.20 | rds.mysql.s1.medium rds.mysql.s1.large rds.mysql.s1.xlarge rds.mysql.s1.2xlarge rds.mysql.m1.2xlarge rds.mysql.c2.medium rds.mysql.c2.large rds.mysql.c2.xlarge rds.mysql.m1.large rds.mysql.m1.xlarge |
| SQLServer | 2014 SP2 SE | rds.mssql.s1.xlarge rds.mssql.m1.2xlarge rds.mssql.c2.xlarge rds.mssql.s1.2xlarge rds.mssql.m1.xlarge |

## Attributes Reference

`id` is set to the ID of the found rds flavor. In addition, the following attributes are exported:
Expand Down
9 changes: 5 additions & 4 deletions docs/data-sources/rds_flavors_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Use this data source to get available OpenTelekomCloud RDSv3 flavors.
```hcl
data "opentelekomcloud_rds_flavors_v3" "flavor" {
db_type = "PostgreSQL"
db_version = "9.5"
db_version = "16"
instance_mode = "ha"
}
```
Expand All @@ -28,9 +28,10 @@ data "opentelekomcloud_rds_flavors_v3" "flavor" {

* `db_type` - (Required) Specifies the DB engine. Possible values are: `MySQL`, `PostgreSQL`, `SQLServer`.

* `db_version` - (Required) Specifies the database version. `MySQL` databases support `5.6`,
`5.7` and `8.0`. `PostgreSQL` databases support `9.5`, `9.6`, `10`, `11`, `12` and `13`.
`SQLServer` databases support `2014_SE`, `2016_SE`, `2016_EE`, `2017_SE` and `2017_EE`.
* `db_version` - (Required) Specifies the database version.
* MySQL: 8.0, 5.7, and 5.6
* PostgreSQL: 11 through 16
* Microsoft SQL Server: 2017 (Enterprise/Standard) through 2022 (Enterprise/Standard)

* `instance_mode` - (Required) The mode of instance. Possible values are:
`ha` indicates primary/standby instance, `single` indicates single instance
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/rds_versions_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ data "opentelekomcloud_rds_versions_v3" "versions" {

In addition, the following attributes are exported:

* `versions` - List of version names, sorted by a version (higher to lower). Example: `["11", "10", "9.6", "9.5"]`.
* `versions` - List of version names, sorted by a version (higher to lower). Example: `["16", "14", "14", "13"]`.
22 changes: 11 additions & 11 deletions docs/resources/rds_instance_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Manages RDS instance v1 resource within OpenTelekomCloud.
```hcl
data "opentelekomcloud_rds_flavors_v1" "flavor" {
datastore_name = "PostgreSQL"
datastore_version = "9.5.5"
speccode = "rds.pg.s1.large.ha"
datastore_version = "16"
speccode = "rds.pg.x1.xlarge.4"
}
resource "opentelekomcloud_compute_secgroup_v2" "secgrp_rds" {
Expand All @@ -37,12 +37,12 @@ resource "opentelekomcloud_rds_instance_v1" "instance" {
datastore {
type = "PostgreSQL"
version = "9.5.5"
version = "16"
}
flavorref = data.opentelekomcloud_rds_flavors_v1.flavor.id
volume {
type = "COMMON"
type = "CLOUDSSD"
size = 200
}
vpc = "c1095fe7-03df-4205-ad2d-6f4c181d436e"
Expand Down Expand Up @@ -75,8 +75,8 @@ resource "opentelekomcloud_rds_instance_v1" "instance" {
```hcl
data "opentelekomcloud_rds_flavors_v1" "flavor" {
datastore_name = "SQLServer"
datastore_version = "2014 SP2 SE"
speccode = "rds.mssql.s1.2xlarge"
datastore_version = "2022_SE"
speccode = "rds.mssql.c2.xlarge"
}
resource "opentelekomcloud_compute_secgroup_v2" "secgrp_rds" {
Expand All @@ -94,7 +94,7 @@ resource "opentelekomcloud_rds_instance_v1" "instance" {
datastore {
type = "SQLServer"
version = "2014 SP2 SE"
version = "2022_SE"
}
volume {
type = "COMMON"
Expand All @@ -118,8 +118,8 @@ resource "opentelekomcloud_rds_instance_v1" "instance" {
```hcl
data "opentelekomcloud_rds_flavors_v1" "flavor" {
datastore_name = "MySQL"
datastore_version = "5.6.33"
speccode = "rds.mysql.s1.medium"
datastore_version = "8.0"
speccode = "rds.mysql.n1.2xlarge.2"
}
resource "opentelekomcloud_compute_secgroup_v2" "secgrp_rds" {
Expand All @@ -137,10 +137,10 @@ resource "opentelekomcloud_rds_instance_v1" "instance" {
flavorref = data.opentelekomcloud_rds_flavors_v1.flavor.id
datastore {
type = "MySQL"
version = "5.6.33"
version = "8.0"
}
volume {
type = "COMMON"
type = "CLOUDSSD"
size = 200
}
nics {
Expand Down
41 changes: 21 additions & 20 deletions docs/resources/rds_instance_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
db {
password = "P@ssw0rd1!9851"
type = "PostgreSQL"
version = "9.5"
version = "16"
port = "8635"
}
security_group_id = opentelekomcloud_networking_secgroup_v2.secgroup.id
subnet_id = var.subnet_id
vpc_id = var.vpc_id
flavor = "rds.pg.c2.medium"
flavor = "rds.pg.n1.large.4"
volume {
type = "CLOUDSSD"
Expand Down Expand Up @@ -72,13 +72,13 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
db {
password = "P@ssw0rd1!9851"
type = "PostgreSQL"
version = "9.5"
version = "16"
port = "8635"
}
security_group_id = opentelekomcloud_networking_secgroup_v2.secgroup.id
subnet_id = var.subnet_id
vpc_id = var.vpc_id
flavor = "rds.pg.s1.medium.ha"
flavor = "rds.pg.x1.8xlarge.4.ha"
ha_replication_mode = "async"
volume {
Expand Down Expand Up @@ -116,7 +116,7 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
db {
password = "Telekom!120521"
type = "PostgreSQL"
version = "9.5"
version = "16"
port = "8635"
}
name = "terraform_test_rds_instance"
Expand All @@ -127,7 +127,7 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
type = "CLOUDSSD"
size = 100
}
flavor = "rds.pg.s1.medium.ha"
flavor = "rds.pg.x1.8xlarge.4.ha"
ha_replication_mode = "async"
backup_strategy {
start_time = "08:00-09:00"
Expand Down Expand Up @@ -164,12 +164,12 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
security_group_id = opentelekomcloud_networking_secgroup_v2.secgroup.id
subnet_id = var.subnet_id
vpc_id = var.vpc_id
flavor = "rds.pg.c2.medium"
flavor = "rds.pg.n1.xlarge.2"
db {
password = "P@ssw0rd1!9851"
type = "PostgreSQL"
version = "9.5"
version = "16"
port = "8635"
}
Expand Down Expand Up @@ -199,7 +199,7 @@ resource "opentelekomcloud_rds_parametergroup_v3" "pg" {
}
datastore {
type = "postgresql"
version = "10"
version = "16"
}
}
Expand All @@ -210,14 +210,14 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
db {
password = "Postgres!120521"
type = "PostgreSQL"
version = "10"
version = "16"
port = "8635"
}
security_group_id = opentelekomcloud_networking_secgroup_v2.sg.id
subnet_id = var.subnet_id
vpc_id = var.vpc_id
flavor = "rds.pg.c2.medium"
flavor = "rds.pg.n1.xlarge.2"
volume {
type = "CLOUDSSD"
size = 40
Expand All @@ -240,7 +240,7 @@ data "opentelekomcloud_rds_backup_v3" "backup" {
resource "opentelekomcloud_rds_instance_v3" "from_backup" {
name = "instance-restored"
availability_zone = opentelekomcloud_rds_instance_v3.instance.availability_zone
flavor = "rds.pg.c2.medium"
flavor = "rds.pg.n1.xlarge.2"
restore_point {
instance_id = data.opentelekomcloud_rds_backup_v3.backup.instance_id
Expand All @@ -250,7 +250,7 @@ resource "opentelekomcloud_rds_instance_v3" "from_backup" {
db {
password = "Postgres!120521"
type = "PostgreSQL"
version = "10"
version = "16"
port = "8635"
}
security_group_id = var.security_group_id
Expand Down Expand Up @@ -287,7 +287,7 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
type = "CLOUDSSD"
size = 40
}
flavor = "rds.mysql.c2.medium"
flavor = "rds.mysql.s1.medium"
backup_strategy {
start_time = "08:00-09:00"
keep_days = 1
Expand Down Expand Up @@ -324,7 +324,7 @@ The following arguments are supported:

* `flavor` - (Required) Specifies the specification code.
Use data source [opentelekomcloud_rds_flavors_v3](../data-sources/rds_flavors_v3.md) to get a list of available flavor names.
Examples could be `rds.pg.c2.medium` or `rds.pg.c2.medium.ha` for HA clusters.
Examples could be `rds.pg.n1.large.4` or `rds.pg.x1.8xlarge.4.ha` for HA clusters.

* `name` - (Required, ForceNew) 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
Expand All @@ -347,8 +347,8 @@ The following arguments are supported:
is async or semisync. For PostgreSQL, the value is async or sync. For Microsoft SQL Server, the value is sync.
Parameter is required for HA clusters.

-> Async indicates the asynchronous replication mode. `semisync` indicates the
semi-synchronous replication mode. sync indicates the synchronous
-> `async` indicates the asynchronous replication mode. `semisync` indicates the
semi-synchronous replication mode. `sync` indicates the synchronous
replication mode. Changing this parameter will create a new resource.

* `param_group_id` - (Optional) Specifies the parameter group ID.
Expand Down Expand Up @@ -404,9 +404,10 @@ The `db` block supports:

* `type` - (Required, ForceNew) Specifies the DB engine. Value: MySQL, PostgreSQL, SQLServer. Changing this parameter will create a new resource.

* `version` - (Required, ForceNew) Specifies the database version. MySQL databases support MySQL 5.6
and above. PostgreSQL databases support PostgreSQL 9.5 and above. Microsoft SQL Server
databases support 2014 SE, 2016 SE, and above.
* `version` - (Required, ForceNew) Specifies the database version.
* MySQL: 8.0, 5.7, and 5.6
* PostgreSQL: 11 through 16
* Microsoft SQL Server: 2017 (Enterprise/Standard) through 2022 (Enterprise/Standard)
Changing this parameter will create a new resource.

The `volume` block supports:
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/rds_parametergroup_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "opentelekomcloud_rds_parametergroup_v3" "pg_1" {
}
datastore {
type = "mysql"
version = "5.6"
version = "8.0"
}
}
```
Expand All @@ -56,9 +56,9 @@ The `datastore` block supports:
The value is case-insensitive and can be `mysql`, `postgresql` or `sqlserver`.

* `version` - (Required) Specifies the database version.
* MySQL databases support MySQL `5.6`, `5.7`, `8.0`. Example value: `5.7`.
* PostgreSQL databases support PostgreSQL `9.5`, `9.6`, `10` and `11`. Example value: `9.5`.
* Microsoft SQL Server databases support `2014 SE`, `2016 SE`, and `2016 EE`. Example value: `2014_SE`.
* MySQL databases support MySQL `5.6`, `5.7`, `8.0`. Example value: `8.0`.
* PostgreSQL databases support PostgreSQL `11`, `12` and above. Example value: `16`.
* Microsoft SQL Server databases support `2017_SE`, `2017_EE`, and above. Example value: `2022_EE`.


## Attributes Reference
Expand Down
12 changes: 8 additions & 4 deletions docs/resources/rds_read_replica_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ resource "opentelekomcloud_rds_instance_v3" "instance" {
db {
password = var.db_password
type = "PostgreSQL"
version = "10"
version = "16"
port = "8635"
}
security_group_id = var.sg_id
subnet_id = var.os_network_id
vpc_id = var.os_router_id
flavor = "rds.pg.c2.medium"
flavor = "rds.pg.n1.medium.4.rr"
volume {
type = "ULTRAHIGH"
type = "CLOUDSSD"
size = 40
}
backup_strategy {
Expand All @@ -53,7 +53,7 @@ resource "opentelekomcloud_rds_read_replica_v3" "replica" {
availability_zone = var.az_replica
volume {
type = "COMMON"
type = "CLOUDSSD"
}
}
```
Expand Down Expand Up @@ -90,6 +90,10 @@ The `volume` block supports:
following and is case-sensitive.
* `COMMON`: indicates the SATA type.
* `ULTRAHIGH`: indicates the SSD type.
* `ESSD`: indicates the extreme SSD type.

-> Note
The MySQL and PostgreSQL supports CLOUDSSD and ESSD, SQL Server supports only ESSD

## Attributes Reference

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/opentelekomcloud/gophertelekomcloud v0.9.4-0.20250115161007-a7fae3c659fc h1:JDr/sgKTh98agnyd5aEZp7EiYKTjwHAG5FW+bGFboig=
github.com/opentelekomcloud/gophertelekomcloud v0.9.4-0.20250115161007-a7fae3c659fc/go.mod h1:la8cQVYopRoEbNe2L7HlGTdLxUQOwIqHp1VHtjE/5qA=
github.com/opentelekomcloud/gophertelekomcloud v0.9.4-0.20250117142924-89e7b723fcc7 h1:MGGtjRYekil3cch//l2gQBZWv32d/4ztF9GlO6FfCBI=
github.com/opentelekomcloud/gophertelekomcloud v0.9.4-0.20250117142924-89e7b723fcc7/go.mod h1:la8cQVYopRoEbNe2L7HlGTdLxUQOwIqHp1VHtjE/5qA=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func checkClusterOperationCompleted(client *golangsdk.ServiceClient, id string,
if cluster.Status != "200" {
return false, nil
}
if cluster.Actions != nil && len(cluster.Actions) > 0 {
if len(cluster.Actions) > 0 {
return false, nil
}
if cluster.Instances == nil {
Expand Down
4 changes: 4 additions & 0 deletions releasenotes/notes/rds_doc_fix-8cd3218ef3c9c531.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
other:
- |
**[RDS]** Various documentation updates for RDS resources and data sources (`#2798 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2798>`_)

0 comments on commit 22f128b

Please sign in to comment.