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
Copy file name to clipboardExpand all lines: docs/CONFIG-VARS.md
+29-5Lines changed: 29 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,11 +269,31 @@ postgres_servers = {
269
269
270
270
**NOTE**: The `default = {}` elements is always required when creating external databases. This is the systems default database server.
271
271
272
-
Each server element, like `foo = {}`, can contain none, some, or all of the parameters listed below:
272
+
Each server element, like `foo = {}`, can contain none, some, or all of the parameters listed below. The `machine_type` and `edition` parameters must be explicitly specified and will be validated based on the `server_version`:
273
+
274
+
- For PostgreSQL 16+:
275
+
-`edition` must be `"ENTERPRISE_PLUS"`
276
+
-`machine_type` must start with `"db-perf-optimized-N-"`
277
+
- For PostgreSQL < 16:
278
+
-`edition` must be `"ENTERPRISE"`
279
+
-`machine_type` must start with `"db-custom-"`
280
+
281
+
*NOTE*: The default = {} elements is always required when creating external databases. This is the systems default database server.
282
+
283
+
If you provide an empty block for default, the following default values will be used:
284
+
terraform
285
+
postgres_servers = {
286
+
default = {
287
+
server_version = "15"
288
+
edition = "ENTERPRISE"
289
+
machine_type = "db-custom-4-16384"
290
+
}
291
+
}
273
292
274
293
| Name | Description | Type | Default | Notes |
275
294
| :--- | ---: | ---: | ---: | ---: |
276
-
| machine_type| The machine type for the PostgreSQL server VMs" | string | "db-custom-4-16384" | Google Cloud Postgres supports only shared-core machine types such as db-f1-micro, and custom machine types such as db-custom-2-13312. |
295
+
| machine_type| The machine type for the PostgreSQL server VMs" | string | "db-custom-4-16384" | Google Cloud Postgres supports only shared-core machine types such as db-f1-micro, and custom machine types such as db-custom-2-13312. Must match the PostgreSQL version requirements. |
296
+
| edition | Cloud SQL edition type | string | "ENTERPRISE" | Must be `"ENTERPRISE"` for PostgreSQL < 16 or `"ENTERPRISE_PLUS"` for PostgreSQL 16+. |
277
297
| storage_gb | Minimum storage allowed for the PostgreSQL server | number | 128 ||
| backups_start_time | Start time for postgres backups | string | "21:00" ||
@@ -289,15 +309,18 @@ Each server element, like `foo = {}`, can contain none, some, or all of the para
289
309
290
310
Multiple SAS offerings require a second PostgreSQL instance referred to as SAS Common Data Store, or CDS PostgreSQL. For more information, see [Common Customizations](https://documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=dplyml0phy0dkr&docsetTarget=n08u2yg8tdkb4jn18u8zsi6yfv3d.htm#p0wkxxi9s38zbzn19ukjjaxsc0kl). A list of SAS offerings that require CDS PostgreSQL is provided in [SAS Common Data Store Requirements](https://documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=itopssr&docsetTarget=p05lfgkwib3zxbn1t6nyihexp12n.htm#n03wzanutmc6gon1val5fykas9aa). To create and configure an external CDS PostgreSQL instance in addition to the external platform PostgreSQL instance named `default`, specify `cds-postgres` as a second PostgreSQL instance, as shown in the example below.
291
311
292
-
Here is an example of the `postgres_servers` variable with the `default` server entry overriding only the `administrator_password` parameter and the `cds-postgres` entry overriding all of the parameters:
312
+
Here is an example of the `postgres_servers` variable with the `default` server entry and the `cds-postgres` entry, both with explicit edition and machine type configurations that match their PostgreSQL versions:
293
313
294
314
```terraform
295
315
postgres_servers = {
296
316
default = {
297
317
administrator_password = "D0ntL00kTh1sWay"
318
+
server_version = "16" # PostgreSQL 16
319
+
machine_type = "db-perf-optimized-N-8" # Required for PostgreSQL 16+
320
+
edition = "ENTERPRISE_PLUS" # Required for PostgreSQL 16+
298
321
},
299
322
cds-postgres = {
300
-
machine_type = "db-custom-4-16384"
323
+
machine_type = "db-custom-4-16384" # Required for PostgreSQL < 16
301
324
storage_gb = 128
302
325
backups_enabled = true
303
326
backups_start_time = "21:00"
@@ -306,7 +329,8 @@ postgres_servers = {
306
329
backup_count = 7 # Number of backups to retain, not in days
307
330
administrator_login = "cdsadmin"
308
331
administrator_password = "my$up3rS3cretPassw0rd"
309
-
server_version = "15"
332
+
server_version = "15" # PostgreSQL 15
333
+
edition = "ENTERPRISE" # Required for PostgreSQL < 16
310
334
availability_type = "ZONAL"
311
335
ssl_enforcement_enabled = true
312
336
database_flags = [{ name = "cloudsql.enable_pg_cron", value = "true"}, { name = "cloudsql.enable_pgaudit", value = "true"}]
error_message="ERROR: The database server name must start with a letter, cannot end with a hyphen, must be between 1-88 characters in length, and can only contain hyphens, letters, and numbers."
410
412
}
411
413
412
-
# Checking user provided login
413
-
414
-
# Checking user provided password
414
+
# Validate edition and machine type based on PostgreSQL version
0 commit comments