Skip to content

Commit

Permalink
Merge pull request #8 from oaknational/feat/ENG-1057-vpc-connections
Browse files Browse the repository at this point in the history
[ENG-1057] Force SQL instances to use private connections only
tweakster authored Dec 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 227f081 + c06f64c commit 293e532
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/gcp_sql/instance.tf
Original file line number Diff line number Diff line change
@@ -29,7 +29,9 @@ resource "google_sql_database_instance" "this" {
}

ip_configuration {
require_ssl = true
ipv4_enabled = true
private_network = var.vpc_network_link
require_ssl = true
}

maintenance_window {
6 changes: 6 additions & 0 deletions modules/gcp_sql/variables.tf
Original file line number Diff line number Diff line change
@@ -53,6 +53,12 @@ variable "memory" {
}
}

variable "vpc_network_link" {
description = "The resource name of the VPC e.g. projects/{project}/global/networks/{vpc_name}"
type = string
nullable = false
}

variable "deletion_protection" {
description = "While set to true the instance cannot be deleted"
type = bool

0 comments on commit 293e532

Please sign in to comment.