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
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,14 +269,19 @@ 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. If `machine_type` or `edition` are not provided, default values will be applied based on the `server_version`. For example:
273
-
- If `server_version >= 16`, defaults to `edition = "ENTERPRISE_PLUS"` and `machine_type = "db-perf-optimized-N-*"`
274
-
- If `server_version < 16`, defaults to `edition = "ENTERPRISE"` and `machine_type = "db-custom-*"`
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-"`
275
280
276
281
| Name | Description | Type | Default | Notes |
277
282
| :--- | ---: | ---: | ---: | ---: |
278
-
| 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. |
279
-
| edition | Cloud SQL edition type | string |*(auto-determined)*|Accepts `"ENTERPRISE"` or `"ENTERPRISE_PLUS"`. Automatically set based on `server_version` if omitted. |
283
+
| 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. |
284
+
| edition | Cloud SQL edition type | string |null|Must be `"ENTERPRISE"`for PostgreSQL < 16 or `"ENTERPRISE_PLUS"` for PostgreSQL 16+. |
280
285
| storage_gb | Minimum storage allowed for the PostgreSQL server | number | 128 ||
| backups_start_time | Start time for postgres backups | string | "21:00" ||
@@ -292,18 +297,18 @@ Each server element, like `foo = {}`, can contain none, some, or all of the para
292
297
293
298
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.
294
299
295
-
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:
300
+
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:
296
301
297
302
```terraform
298
303
postgres_servers = {
299
304
default = {
300
305
administrator_password = "D0ntL00kTh1sWay"
301
-
server_version = "" # Specify PostgreSQL version here
302
-
machine_type = "" # Specify the machine type here
303
-
edition = "" # Specify the edition here (e.g., ENTERPRISE, ENTERPRISE_PLUS)
306
+
server_version = "16" # PostgreSQL 16
307
+
machine_type = "db-perf-optimized-N-8" # Required for PostgreSQL 16+
308
+
edition = "ENTERPRISE_PLUS" # Required for PostgreSQL 16+
304
309
},
305
310
cds-postgres = {
306
-
machine_type = "db-custom-4-16384"
311
+
machine_type = "db-custom-4-16384" # Required for PostgreSQL < 16
307
312
storage_gb = 128
308
313
backups_enabled = true
309
314
backups_start_time = "21:00"
@@ -312,7 +317,8 @@ postgres_servers = {
312
317
backup_count = 7 # Number of backups to retain, not in days
313
318
administrator_login = "cdsadmin"
314
319
administrator_password = "my$up3rS3cretPassw0rd"
315
-
server_version = "15"
320
+
server_version = "15" # PostgreSQL 15
321
+
edition = "ENTERPRISE" # Required for PostgreSQL < 16
316
322
availability_type = "ZONAL"
317
323
ssl_enforcement_enabled = true
318
324
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."
411
411
}
412
412
413
-
# Checking user provided login
414
-
415
-
# Checking user provided password
413
+
# Validate edition and machine type based on PostgreSQL version
0 commit comments