| databases |
Names of databases to create. |
list(string) |
n/a |
yes |
| init |
Entur init module output. https://github.com/entur/terraform-google-init. Used to determine application name, application project, labels, and resource names. |
object({ app = object({ id = string name = string owner = string project_id = string }) networks = object({ project_id = string vpc_id = string }) environment = string labels = map(string) is_production = bool }) |
n/a |
yes |
| add_additional_secret_manager_credentials |
Set to false to not store additional database credentials in secret manager |
bool |
true |
no |
| add_main_secret_manager_credentials |
Set to false to not store main database credentials in secret manager |
bool |
true |
no |
| additional_users |
A list of user-names in addition to the main user that should be created. |
map(object({ username = string create_kubernetes_secret = bool })) |
{} |
no |
| authorized_networks |
Values for authorized_networks, list of objects with name and simple strings of IPs or CIDRs. Ex: {name: supermachine, value: 35.90.103.132/30} or {name: rogersmachine, value: 35.90.103.132} |
list(object({ value = string name = string })) |
[] |
no |
| availability_type |
Whether to enable high availability with automatic failover over multiple zones ('REGIONAL') vs. single zone ('ZONAL'). |
string |
null |
no |
| backup_start_time |
Start time in UTC for daily backup job in the format HH:MM. This is the start time of a 4 hour time window. |
string |
"00:00" |
no |
| create_kubernetes_resources |
Optionally disables creating k8s resources -psql-connection and -psql-credentials. Can be used to avoid overwriting existing resources on database creation. |
bool |
true |
no |
| database_flags |
Override default CloudSQL configuration by specifying database-flags. Note that some flags require installing extensions. (see https://cloud.google.com/sql/docs/postgres/extensions#installing-an-extension). |
map(object({ name = string value = string })) |
{} |
no |
| database_version |
The PostgreSQL version (see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance#database_version). |
string |
"POSTGRES_14" |
no |
| deletion_protection |
Whether or not to allow Terraform to destroy the instance. |
bool |
null |
no |
| disable_offsite_backup |
Disable offsite backup for this instance. Offsite backup is only applied to production environments. |
bool |
false |
no |
| disk_autoresize |
Whether to enable auto-resizing of the storage disk. |
bool |
true |
no |
| disk_autoresize_limit |
The maximum size an auto-resized disk can reach. Default is 500 for production, 50 for non-production. |
number |
null |
no |
| disk_size |
The storage disk size of the instance. Default is 10 (GB). Only takes effect if disk_autoresize is set to 'false'. |
number |
10 |
no |
| enable_backup |
Whether to enable daily backup of databases. |
bool |
true |
no |
| enable_private_network |
Whether to enable private network connectivity for the Cloud SQL instance. Immutable after it has been enabled. |
bool |
false |
no |
| generation |
The generation (aka serial no.) of the instance. Starts at 1, ends at 999. Will be padded with leading zeros. |
number |
1 |
no |
| instance_edition |
Override the default instance edition (ENTERPRISE or ENTERPRISE_PLUS). |
string |
"ENTERPRISE" |
no |
| machine_size |
Map of the database instance CPU count (cpu) and memory sizes in MB (memory). Optionally, set a tier override (tier). See README.md for examples. |
map(any) |
null |
no |
| maintenance_window |
The day of the week (1-7), and hour of the day (0-24) in UTC to perform database instance maintenance. This is the start time of the one hour maintinance window. |
object({ day = number hour = number }) |
{ "day": 2, "hour": 0 } |
no |
| point_in_time_recovery_enabled |
Whether to enable PITR on database instance. Requires enable_backup to be true. |
bool |
true |
no |
| query_insights_config |
Advanced config for Query Insights. |
object({ query_string_length = number record_application_tags = bool record_client_address = bool }) |
{ "query_string_length": 1024, "record_application_tags": false, "record_client_address": false } |
no |
| query_insights_enabled |
Whether to enable query insights (7 day retention). |
bool |
false |
no |
| region |
The region the instance will sit in. |
string |
"europe-west1" |
no |
| retain_backups_on_delete |
When this parameter is set to true, Cloud SQL retains backups of the instance even after the instance is deleted. |
bool |
true |
no |
| retained_backups |
The number of backups to retain. Default is 30 for production, 7 for non-production. |
number |
null |
no |
| secret_key_prefix |
Key prefix of secret. Ex. {secret_key_prefix: PSQL_} would give keys PSQL_USER, PSQL_PASSWORD and so on |
string |
"PG" |
no |
| transaction_log_retention_days |
How long transaction logs are stored (1-7). |
number |
7 |
no |
| user_name |
The username of the default application user. Defaults to the app ID. |
string |
null |
no |