Skip to content

Authorized networks #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
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