Name | Version |
---|---|
terraform | ~> 0.14 |
~> 3.10 | |
google-beta | ~> 3.10 |
Name | Source | Version |
---|---|---|
default | modules/cloudsql-single/ | n/a |
default | modules/cloudsql-replica/ | n/a |
terraform init
terraform plan
terraform apply -auto-approve
for example:
USER
additional_users = [
{
name = "app_user"
password = ""
},
{
name = "app_user_b"
password = ""
},
]
REPLICA
// Read replica configurations
read_replica_name_suffix = "replica"
read_replicas = [
{
instance_name = "0"
zone = "asia-southeast1-b"
zone_availability_type = "ZONAL"
tier = "db-custom-1-2048"
ip_configuration = local.read_replica_ip_configuration
disk_autoresize = true
disk_autoresize_limit = 0
disk_size = 20
disk_type = "PD_HDD"
environment = { "environment" = "dev" }
},
{
instance_name = "1"
zone = "asia-southeast1-c"
zone_availability_type = "ZONAL"
tier = "db-custom-1-2048"
ip_configuration = local.read_replica_ip_configuration
disk_autoresize = true
disk_autoresize_limit = 0
disk_size = 20
disk_type = "PD_HDD"
environment = { "environment" = "dev" }
},
]