Skip to content

Commit c932db5

Browse files
feat: Add optional capacities to owner
1 parent da8169c commit c932db5

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

database.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ locals {
33
}
44

55
resource "postgresql_role" "owner" {
6-
name = local.owner
7-
login = var.owner_password != null ? true : false
8-
password = var.owner_password
9-
roles = var.roles
6+
name = local.owner
7+
login = var.owner_password != null ? true : false
8+
create_database = var.owner_create_database
9+
create_role = var.owner_create_role
10+
password = var.owner_password
11+
roles = var.roles
1012

1113
connection_limit = var.connection_limit
1214

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ variable "owner" {
1919
default = ""
2020
}
2121

22+
variable "owner_create_database" {
23+
description = "Defines a role's ability to execute `CREATE DATABASE`"
24+
default = false
25+
}
26+
27+
variable "owner_create_role" {
28+
description = "Defines a role's ability to execute `CREATE ROLE`. A role with this privilege can also alter and drop other roles."
29+
default = false
30+
}
31+
2232
variable "owner_password" {
2333
description = "The password for the owner of the database"
2434
type = string

0 commit comments

Comments
 (0)