diff --git a/examples/data-solutions/cloudsql-multiregion/README.md b/examples/data-solutions/cloudsql-multiregion/README.md index 7a70ee98..be44ff8f 100644 --- a/examples/data-solutions/cloudsql-multiregion/README.md +++ b/examples/data-solutions/cloudsql-multiregion/README.md @@ -45,13 +45,15 @@ This implementation is intentionally minimal and easy to read. A real world use | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [prefix](variables.tf#L29) | Unique prefix used for resource names. Not used for project if 'project_create' is null. | string | ✓ | | -| [project_id](variables.tf#L43) | Project id, references existing project if `project_create` is null. | string | ✓ | | -| [cloudsql_psa_range](variables.tf#L17) | Range used for the Private Service Access. | string | | "10.60.0.0/16" | -| [database_version](variables.tf#L23) | Database type and version to create. | string | | "POSTGRES_13" | -| [project_create](variables.tf#L34) | Provide values if project creation is needed, uses existing project if null. Parent is in 'folders/nnn' or 'organizations/nnn' format. | object({…}) | | null | -| [regions](variables.tf#L48) | Map of instance_name => location where instances will be deployed. | map(string) | | {…} | -| [tier](variables.tf#L61) | The machine type to use for the instances. See See https://cloud.google.com/sql/docs/postgres/create-instance#machine-types. | string | | "db-g1-small" | +| [postgres_user_password](variables.tf#L29) | `postgres` user password. | string | ✓ | | +| [prefix](variables.tf#L40) | Unique prefix used for resource names. Not used for project if 'project_create' is null. | string | ✓ | | +| [project_id](variables.tf#L54) | Project id, references existing project if `project_create` is null. | string | ✓ | | +| [cmek_encryption](variables.tf#L17) | Flag to enable CMEK on GCP resources created. | bool | | false | +| [data_eng_principals](variables.tf#L23) | Groups with Service Account Token creator role on service accounts in IAM format, only user supported on CloudSQL, eg 'user@domain.com'. | list(string) | | [] | +| [postgres_databases](variables.tf#L34) | `postgres` databases. | list(string) | | ["guestbook"] | +| [project_create](variables.tf#L45) | Provide values if project creation is needed, uses existing project if null. Parent is in 'folders/nnn' or 'organizations/nnn' format. | object({…}) | | null | +| [regions](variables.tf#L59) | Map of instance_name => location where instances will be deployed. | map(string) | | {…} | +| [sql_configuration](variables.tf#L73) | Cloud SQL configuration | object({…}) | | {…} | ## Outputs diff --git a/examples/data-solutions/cloudsql-multiregion/main.tf b/examples/data-solutions/cloudsql-multiregion/main.tf index 6c893753..aeae6e72 100644 --- a/examples/data-solutions/cloudsql-multiregion/main.tf +++ b/examples/data-solutions/cloudsql-multiregion/main.tf @@ -123,6 +123,7 @@ module "db" { encryption_key_name = var.cmek_encryption ? module.kms[v].keys.key.id : null } if k != "primary" } + databases = var.postgres_databases users = { postgres = var.postgres_user_password } diff --git a/examples/data-solutions/cloudsql-multiregion/variables.tf b/examples/data-solutions/cloudsql-multiregion/variables.tf index b1069e2e..941e491b 100644 --- a/examples/data-solutions/cloudsql-multiregion/variables.tf +++ b/examples/data-solutions/cloudsql-multiregion/variables.tf @@ -30,6 +30,13 @@ variable "postgres_user_password" { description = "`postgres` user password." type = string } + +variable "postgres_databases" { + description = "`postgres` databases." + type = list(string) + default = ["guestbook"] +} + variable "prefix" { description = "Unique prefix used for resource names. Not used for project if 'project_create' is null." type = string