Skip to content

Commit 05fc86f

Browse files
authored
Support connection_limit per role (#11)
1 parent 694223b commit 05fc86f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

roles.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ resource "postgresql_role" "role" {
2828
login = true
2929
replication = false
3030
bypass_row_level_security = false
31-
connection_limit = -1
31+
connection_limit = coalesce(each.value.connection_limit, -1)
3232
encrypted_password = true
3333
password = random_password.role[each.key].result
3434
roles = concat(

variables.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ variable "legacy_writers" {
55

66
variable "roles" {
77
type = map(object({
8-
databases_ro = list(string)
9-
databases_rw = list(string)
8+
connection_limit = optional(number)
9+
databases_ro = list(string)
10+
databases_rw = list(string)
1011
}))
1112
}

0 commit comments

Comments
 (0)