Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ resource "google_sql_database_instance" "serverpod" {
}

ip_configuration {
ipv4_enabled = true
private_network = google_compute_network.serverpod.id
ipv4_enabled = true
private_network = google_compute_network.serverpod.id

dynamic "authorized_networks" {
for_each = var.authorized_networks == null ? [] : [var.authorized_networks]
content {
name = var.authorized_networks.name
value = var.authorized_networks.value
}
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ variable "top_domain" {
type = string
}

variable "authorized_networks" {
description = "The networks authorized to connect to the database from outside the Serverpod infrastructure."
type = object({
name = string
value = string
})
default = null
}

variable "autoscaling_min_size" {
description = "The minimum number of instances to run in the autoscaling group. Defaults to 1."
default = 1
Expand Down