|
|
|
@ -25,6 +25,11 @@ variable "private_network_id" {
|
|
|
|
|
type = string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "connection_name" {
|
|
|
|
|
description = "The connection string for connecting to the cloudsql instance (for example, through cloudsql proxy)."
|
|
|
|
|
value = google_sql_database_instance.instance.connection_name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "random_id" "cloudsql" {
|
|
|
|
|
byte_length = 4
|
|
|
|
|
}
|
|
|
|
@ -41,6 +46,7 @@ resource "google_sql_database_instance" "instance" {
|
|
|
|
|
ip_configuration {
|
|
|
|
|
ipv4_enabled = false
|
|
|
|
|
private_network = var.private_network_id
|
|
|
|
|
require_ssl = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|