Only use local networking for cloudsql.

This commit is contained in:
Tom Alexander
2021-07-12 22:25:12 -04:00
parent 07b38295c3
commit b8216c71be
3 changed files with 47 additions and 3 deletions

View File

@@ -20,6 +20,11 @@ variable "db_version" {
default = "POSTGRES_13"
}
variable "private_network_id" {
description = "Private network id."
type = string
}
resource "google_sql_database_instance" "instance" {
project = var.project
region = var.region
@@ -29,6 +34,11 @@ resource "google_sql_database_instance" "instance" {
settings {
tier = var.tier
ip_configuration {
ipv4_enabled = false
private_network = var.private_network_id
}
}
deletion_protection = "true"