You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~> **Warning** Provider versions prior to `2.61.0` did not support engine upgrades. Changing the `engine` value in these versions would recreate the Database Instance **empty**, resulting in **data loss**. Ensure you are using provider version `>= 2.61.0` before upgrading your Database Instance engine version.
61
+
```terraform
62
+
### Usage of ephemeral random_password for instance password without storing it in state
63
+
64
+
// Generate an ephemeral password (not stored in the state)
65
+
ephemeral "random_password" "db_password" {
66
+
length = 20
67
+
special = true
68
+
upper = true
69
+
lower = true
70
+
numeric = true
71
+
min_upper = 1
72
+
min_lower = 1
73
+
min_numeric = 1
74
+
min_special = 1
75
+
# Exclude characters that might cause issues in some contexts
76
+
override_special = "!@#$%^&*()_+-=[]{}|;:,.<>?"
77
+
}
78
+
79
+
// Pass the ephemeral password with password_wo (not stored in the state)
#### 1 IPAM Private Network endpoint + 1 public endpoint
139
-
140
133
```terraform
141
-
resource "scaleway_vpc_private_network" "pn" {}
134
+
#### Default: 1 public endpoint
142
135
143
136
resource "scaleway_rdb_instance" "main" {
144
-
node_type = "DB-DEV-S"
137
+
node_type = "db-dev-s"
145
138
engine = "PostgreSQL-15"
146
-
private_network {
147
-
pn_id = scaleway_vpc_private_network.pn.id
148
-
enable_ipam = true
149
-
}
150
-
load_balancer {}
151
139
}
152
140
```
153
141
154
-
#### Default: 1 public endpoint
142
+
```terraform
143
+
### Example Block Storage Low Latency
144
+
145
+
resource "scaleway_rdb_instance" "main" {
146
+
name = "test-rdb-sbs"
147
+
node_type = "db-play2-pico"
148
+
engine = "PostgreSQL-15"
149
+
is_ha_cluster = true
150
+
disable_backup = true
151
+
user_name = "my_initial_user"
152
+
password = "thiZ_is_v&ry_s3cret"
153
+
volume_type = "sbs_15k"
154
+
volume_size_in_gb = 10
155
+
}
156
+
```
157
+
158
+
```terraform
159
+
### Example with backup schedule
160
+
161
+
resource "scaleway_rdb_instance" "main" {
162
+
name = "test-rdb"
163
+
node_type = "DB-DEV-S"
164
+
engine = "PostgreSQL-15"
165
+
is_ha_cluster = true
166
+
user_name = "my_initial_user"
167
+
password = "thiZ_is_v&ry_s3cret"
168
+
169
+
disable_backup = false
170
+
backup_schedule_frequency = 24 # every day
171
+
backup_schedule_retention = 7 # keep it one week
172
+
}
173
+
```
155
174
156
175
```terraform
176
+
### Example with Settings
177
+
157
178
resource "scaleway_rdb_instance" "main" {
158
-
node_type = "db-dev-s"
159
-
engine = "PostgreSQL-15"
179
+
name = "test-rdb"
180
+
node_type = "db-dev-s"
181
+
disable_backup = true
182
+
engine = "MySQL-8"
183
+
user_name = "my_initial_user"
184
+
password = "thiZ_is_v&ry_s3cret"
185
+
init_settings = {
186
+
"lower_case_table_names" = 1
187
+
}
188
+
settings = {
189
+
"max_connections" = "350"
190
+
}
160
191
}
161
192
```
162
193
194
+
195
+
196
+
163
197
-> **Note** If nothing is defined, your Database Instance will have a default public load-balancer endpoint.
164
198
165
199
-> **Note** Managed PostgreSQL and MySQL Database Instances are compatible with the [VPC routing](https://www.scaleway.com/en/docs/network/vpc/concepts/#routing) feature, which allows you to connect one or more Database Instances in a Private Network to resources in other Private Networks of the same VPC. This feature is automatically enabled when your Database Instance is connected to a Private Network within a VPC that has routing enabled. Refer to the [How to manage routing](https://www.scaleway.com/en/docs/network/vpc/how-to/manage-routing/) documentation page for more information about VPC routing.
@@ -191,7 +225,11 @@ interruption.
191
225
192
226
~> **Important** Updates to `user_name` will recreate the Database Instance.
193
227
194
-
-`password` - (Optional) Password for the first user of the Database Instance.
228
+
-`password` - (Optional) Password for the first user of the Database Instance. Only one of `password` or `password_wo` should be specified.
229
+
230
+
-`password_wo` - (Optional) Password for the first user of the Database Instance in [write-only](https://developer.hashicorp.com/terraform/language/manage-sensitive-data/write-only) mode. Only one of `password` or `password_wo` should be specified. `password_wo` will not be set in the Terraform state. To update the `password_wo`, you must also update the `password_wo_version`.
231
+
232
+
-`password_wo_version` - (Optional) The version of the [write-only](https://developer.hashicorp.com/terraform/language/manage-sensitive-data/write-only) password. To update the `password_wo`, you must also update the `password_wo_version`.
195
233
196
234
-`is_ha_cluster` - (Optional) Enable or disable high availability for the Database Instance.
0 commit comments