Skip to content

Commit bd1e06d

Browse files
committed
docs: document password requirements for database resources
1 parent d888258 commit bd1e06d

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

docs/resources/mongodb_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The following arguments are supported:
9595
- `version` - (Optional) MongoDB® version of the instance.
9696
- `node_type` - (Required) The type of MongoDB® intance to create.
9797
- `user_name` - (Optional) Name of the user created when the intance is created.
98-
- `password` - (Optional) Password of the user.
98+
- `password` - (Optional) Password of the user. The password must contain at least 1 digit, 1 uppercase letter, 1 lowercase letter, and 1 special character. For secure password generation, consider using the `random_password` resource with appropriate parameters.
9999
- `name` - (Optional) Name of the MongoDB® instance.
100100
- `tags` - (Optional) List of tags attached to the MongoDB® instance.
101101
- `volume_type` - (Optional) Volume type of the instance.

docs/resources/rdb_instance.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,33 @@ resource "scaleway_rdb_instance" "main" {
2525
}
2626
```
2727

28+
### Example with Secure Random Password
29+
30+
```terraform
31+
resource "random_password" "rdb_password" {
32+
length = 24
33+
special = true
34+
upper = true
35+
lower = true
36+
numeric = true
37+
min_upper = 1
38+
min_lower = 1
39+
min_numeric = 1
40+
min_special = 1
41+
}
42+
43+
resource "scaleway_rdb_instance" "main" {
44+
name = "test-rdb"
45+
node_type = "DB-DEV-S"
46+
engine = "PostgreSQL-15"
47+
is_ha_cluster = true
48+
disable_backup = true
49+
user_name = "my_initial_user"
50+
password = random_password.rdb_password.result
51+
encryption_at_rest = true
52+
}
53+
```
54+
2855
### Example Block Storage Low Latency
2956

3057
```terraform
@@ -153,7 +180,7 @@ interruption.
153180

154181
~> **Important** Updates to `user_name` will recreate the Database Instance.
155182

156-
- `password` - (Optional) Password for the first user of the Database Instance.
183+
- `password` - (Optional) Password for the first user of the Database Instance. The password must contain at least 1 digit, 1 uppercase letter, 1 lowercase letter, and 1 special character. For secure password generation, consider using the `random_password` resource with appropriate parameters.
157184

158185
- `is_ha_cluster` - (Optional) Enable or disable high availability for the Database Instance.
159186

docs/resources/rdb_user.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ resource "scaleway_rdb_instance" "main" {
2424
}
2525
2626
resource "random_password" "db_password" {
27-
length = 16
28-
special = true
27+
length = 20
28+
special = true
29+
upper = true
30+
lower = true
31+
numeric = true
32+
min_upper = 1
33+
min_lower = 1
34+
min_numeric = 1
35+
min_special = 1
2936
}
3037
3138
resource "scaleway_rdb_user" "db_admin" {
@@ -48,7 +55,7 @@ The following arguments are supported:
4855

4956
~> **Important:** Updates to `name` will recreate the database user.
5057

51-
- `password` - (Required) database user password.
58+
- `password` - (Required) database user password. The password must contain at least 1 digit, 1 uppercase letter, 1 lowercase letter, and 1 special character. For secure password generation, consider using the `random_password` resource with appropriate parameters.
5259

5360
- `is_admin` - (Optional) Grant admin permissions to the database user.
5461

docs/resources/redis_cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ you cannot downgrade a Redis™ cluster.
8989

9090
- `user_name` - (Required) Identifier for the first user of the Redis™ cluster.
9191

92-
- `password` - (Required) Password for the first user of the Redis™ cluster.
92+
- `password` - (Required) Password for the first user of the Redis™ cluster. The password must contain at least 1 digit, 1 uppercase letter, 1 lowercase letter, and 1 special character. For secure password generation, consider using the `random_password` resource with appropriate parameters.
9393

9494
- `name` - (Optional) The name of the Redis™ cluster.
9595

0 commit comments

Comments
 (0)