From af995f5b4cb1fcb368b97ba4ddfd6a5120714259 Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sat, 2 Dec 2023 22:50:09 +0100 Subject: [PATCH] feature: grant all on public schema --- generic-database/database.tf | 8 ++++++++ main.tf | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/generic-database/database.tf b/generic-database/database.tf index 6d4f42a..34721a4 100644 --- a/generic-database/database.tf +++ b/generic-database/database.tf @@ -28,3 +28,11 @@ resource "postgresql_grant" "readonly_tables" { object_type = "database" privileges = var.privileges } + +resource "postgresql_grant" "grant_all_public_schema" { + database = postgresql_database.database.name + role = postgresql_role.user.name + object_type = "schema" + schema = var.schema + privileges = ["ALL"] +} \ No newline at end of file diff --git a/main.tf b/main.tf index 30b6490..c91c62f 100644 --- a/main.tf +++ b/main.tf @@ -68,8 +68,9 @@ module "nextcloud" { source = "./generic-database" database_name = "nextcloud" username = "nextcloud" - collate = "fr_FR.UTF-8" - ctype = "fr_FR.UTF-8" + collate = "fr_FR.utf8" + ctype = "fr_FR.utf8" + privileges = ["CREATE", "CONNECT", "TEMPORARY"] } output "ampere_account" {