# --------------------------------------------------------------------------------------------------------------------- # REQUIRED PARAMETERS # These variables are expected to be passed in by the operator # --------------------------------------------------------------------------------------------------------------------- variable "project" { description = "The project ID to host the database in." } variable "region" { description = "The region to host the database in (e.g. 'us-central1')." } variable "master_zone" { description = "The preferred zone for the master instance (e.g. 'us-central1-a'). Must be different than 'failover_replica_zone'." } variable "failover_replica_zone" { description = "The preferred zone for the failover instance (e.g. 'us-central1-b'). Must be different than 'master_zone'." } variable "num_read_replicas" { description = "The number of read replicas to create. Cloud SQL will replicate all data from the master to these replicas, which you can use to horizontally scale read traffic." } variable "read_replica_zones" { description = "A list of compute zones where read replicas should be created. List size should match 'num_read_replicas'" type = "list" # Example: # default = ["us-central1-b", "us-central1-c"] } # Note, after a name db instance is used, it cannot be reused for up to one week. variable "name_prefix" { description = "The name prefix for the database instance. Will be appended with a random string. Use lowercase letters, numbers, and hyphens. Start with a letter." } variable "master_user_name" { description = "The username part for the default user credentials, i.e. 'master_user_name'@'master_user_host' IDENTIFIED BY 'master_user_password'. This should typically be set as the environment variable TF_VAR_master_user_name so you don't check it into source control." } variable "master_user_password" { description = "The password part for the default user credentials, i.e. 'master_user_name'@'master_user_host' IDENTIFIED BY 'master_user_password'. This should typically be set as the environment variable TF_VAR_master_user_password so you don't check it into source control." } # --------------------------------------------------------------------------------------------------------------------- # OPTIONAL PARAMETERS # Generally, these values won't need to be changed. # --------------------------------------------------------------------------------------------------------------------- variable "postgres_version" { description = "The engine version of the database, e.g. `POSTGRES_9_6`. See https://cloud.google.com/sql/docs/features for supported versions." default = "POSTGRES_9_6" } variable "machine_type" { description = "The machine type to use, see https://cloud.google.com/sql/pricing for more details" default = "db-f1-micro" } variable "db_name" { description = "Name for the db" default = "default" } variable "name_override" { description = "You may optionally override the name_prefix + random string by specifying an override" default = "" }