Require ssl for cloudsql.

This commit is contained in:
Tom Alexander 2021-07-18 16:37:26 -04:00
parent 6e99a33921
commit 858d8ad35a
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -25,6 +25,11 @@ variable "private_network_id" {
type = string 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" { resource "random_id" "cloudsql" {
byte_length = 4 byte_length = 4
} }
@ -41,6 +46,7 @@ resource "google_sql_database_instance" "instance" {
ip_configuration { ip_configuration {
ipv4_enabled = false ipv4_enabled = false
private_network = var.private_network_id private_network = var.private_network_id
require_ssl = true
} }
} }