Only use local networking for cloudsql.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user