Add database
This commit is contained in:
parent
6eeda3da7a
commit
58ccbec1f1
|
@ -45,13 +45,15 @@ This implementation is intentionally minimal and easy to read. A real world use
|
||||||
|
|
||||||
| name | description | type | required | default |
|
| name | description | type | required | default |
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [prefix](variables.tf#L29) | Unique prefix used for resource names. Not used for project if 'project_create' is null. | <code>string</code> | ✓ | |
|
| [postgres_user_password](variables.tf#L29) | `postgres` user password. | <code>string</code> | ✓ | |
|
||||||
| [project_id](variables.tf#L43) | Project id, references existing project if `project_create` is null. | <code>string</code> | ✓ | |
|
| [prefix](variables.tf#L40) | Unique prefix used for resource names. Not used for project if 'project_create' is null. | <code>string</code> | ✓ | |
|
||||||
| [cloudsql_psa_range](variables.tf#L17) | Range used for the Private Service Access. | <code>string</code> | | <code>"10.60.0.0/16"</code> |
|
| [project_id](variables.tf#L54) | Project id, references existing project if `project_create` is null. | <code>string</code> | ✓ | |
|
||||||
| [database_version](variables.tf#L23) | Database type and version to create. | <code>string</code> | | <code>"POSTGRES_13"</code> |
|
| [cmek_encryption](variables.tf#L17) | Flag to enable CMEK on GCP resources created. | <code>bool</code> | | <code>false</code> |
|
||||||
| [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. | <code title="object({ billing_account_id = string parent = string })">object({…})</code> | | <code>null</code> |
|
| [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'. | <code>list(string)</code> | | <code>[]</code> |
|
||||||
| [regions](variables.tf#L48) | Map of instance_name => location where instances will be deployed. | <code>map(string)</code> | | <code title="{ primary = "europe-west1" replica = "europe-west3" }">{…}</code> |
|
| [postgres_databases](variables.tf#L34) | `postgres` databases. | <code>list(string)</code> | | <code>["guestbook"]</code> |
|
||||||
| [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. | <code>string</code> | | <code>"db-g1-small"</code> |
|
| [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. | <code title="object({ billing_account_id = string parent = string })">object({…})</code> | | <code>null</code> |
|
||||||
|
| [regions](variables.tf#L59) | Map of instance_name => location where instances will be deployed. | <code>map(string)</code> | | <code title="{ primary = "europe-west1" replica = "europe-west3" }">{…}</code> |
|
||||||
|
| [sql_configuration](variables.tf#L73) | Cloud SQL configuration | <code title="object({ availability_type = string database_version = string psa_range = string tier = string })">object({…})</code> | | <code title="{ availability_type = "REGIONAL" database_version = "POSTGRES_13" psa_range = "10.60.0.0/16" tier = "db-g1-small" }">{…}</code> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ module "db" {
|
||||||
encryption_key_name = var.cmek_encryption ? module.kms[v].keys.key.id : null
|
encryption_key_name = var.cmek_encryption ? module.kms[v].keys.key.id : null
|
||||||
} if k != "primary"
|
} if k != "primary"
|
||||||
}
|
}
|
||||||
|
databases = var.postgres_databases
|
||||||
users = {
|
users = {
|
||||||
postgres = var.postgres_user_password
|
postgres = var.postgres_user_password
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,13 @@ variable "postgres_user_password" {
|
||||||
description = "`postgres` user password."
|
description = "`postgres` user password."
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "postgres_databases" {
|
||||||
|
description = "`postgres` databases."
|
||||||
|
type = list(string)
|
||||||
|
default = ["guestbook"]
|
||||||
|
}
|
||||||
|
|
||||||
variable "prefix" {
|
variable "prefix" {
|
||||||
description = "Unique prefix used for resource names. Not used for project if 'project_create' is null."
|
description = "Unique prefix used for resource names. Not used for project if 'project_create' is null."
|
||||||
type = string
|
type = string
|
||||||
|
|
Loading…
Reference in New Issue