File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ module "database" {
3131
3232 deletion_protection = var. deletion_protection
3333
34+ max_database_connections = var. max_database_connections
35+
3436 depends_on = [module . networking ]
3537}
3638
Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ resource "google_sql_database_instance" "this" {
2929 insights_config {
3030 query_insights_enabled = true
3131 }
32+
33+ dynamic "database_flags" {
34+ for_each = var. max_database_connections != " " ? [1 ] : []
35+ content {
36+ name = " max_connections"
37+ value = var. max_database_connections
38+ }
39+ }
3240 }
3341}
3442
Original file line number Diff line number Diff line change @@ -23,3 +23,9 @@ variable "deletion_protection" {
2323 description = " Whether to enable deletion protection for the database instance."
2424 type = bool
2525}
26+
27+ variable "max_database_connections" {
28+ description = " The maximum number of connections to the database"
29+ type = string
30+ default = " "
31+ }
Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ variable "postgres_version" {
2020 default = " POSTGRES_17"
2121}
2222
23+ variable "max_database_connections" {
24+ description = " The maximum number of connections to the database"
25+ type = string
26+ default = " "
27+ }
28+
2329variable "redis_tier" {
2430 description = " The tier for the Redis instance"
2531 type = string
You can’t perform that action at this time.
0 commit comments