Skip to content

Commit

Permalink
fix: db grant problem with function; wallet opeator permission
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Nov 21, 2023
1 parent 64a9f32 commit 64321c7
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 103 deletions.
104 changes: 104 additions & 0 deletions database-grants/terraform/prod/extra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,107 @@ resource "postgresql_grant" "wallet-operator-seq" {
privileges = ["USAGE", "SELECT"]

}

resource "postgresql_grant" "wallet-operator-schema-public" {
database = "treetracker"
role = "wallet_operator"
schema = "public"
object_type = "schema"
privileges = ["USAGE", "CREATE"]
}

resource "postgresql_grant" "wallet-operator-table-public" {
database = "treetracker"
role = "wallet_operator"
schema = "public"
object_type = "table"
privileges = ["SELECT", "INSERT", "UPDATE", "DELETE"]
}


resource "postgresql_grant" "wallet-operator-seq-public" {
database = "treetracker"
role = "wallet_operator"
schema = "public"
object_type = "sequence"
privileges = ["USAGE", "SELECT"]

}


resource "postgresql_grant" "wallet-operator-schema-herbarium" {
database = "treetracker"
role = "wallet_operator"
schema = "herbarium"
object_type = "schema"
privileges = ["USAGE", "CREATE"]
}

resource "postgresql_grant" "wallet-operator-table-herbarium" {
database = "treetracker"
role = "wallet_operator"
schema = "herbarium"
object_type = "table"
privileges = ["SELECT", "INSERT", "UPDATE", "DELETE"]
}


resource "postgresql_grant" "wallet-operator-seq-herbarium" {
database = "treetracker"
role = "wallet_operator"
schema = "herbarium"
object_type = "sequence"
privileges = ["USAGE", "SELECT"]
}


resource "postgresql_grant" "wallet-operator-schema-stakeholder" {
database = "treetracker"
role = "wallet_operator"
schema = "stakeholder"
object_type = "schema"
privileges = ["USAGE", "CREATE"]
}

resource "postgresql_grant" "wallet-operator-table-stakeholder" {
database = "treetracker"
role = "wallet_operator"
schema = "stakeholder"
object_type = "table"
privileges = ["SELECT", "INSERT", "UPDATE", "DELETE"]
}


resource "postgresql_grant" "wallet-operator-seq-stakeholder" {
database = "treetracker"
role = "wallet_operator"
schema = "stakeholder"
object_type = "sequence"
privileges = ["USAGE", "SELECT"]
}


resource "postgresql_grant" "wallet-operator-schema-treetracker" {
database = "treetracker"
role = "wallet_operator"
schema = "treetracker"
object_type = "schema"
privileges = ["USAGE", "CREATE"]
}

resource "postgresql_grant" "wallet-operator-table-treetracker" {
database = "treetracker"
role = "wallet_operator"
schema = "treetracker"
object_type = "table"
privileges = ["SELECT", "INSERT", "UPDATE", "DELETE"]
}


resource "postgresql_grant" "wallet-operator-seq-treetracker" {
database = "treetracker"
role = "wallet_operator"
schema = "treetracker"
object_type = "sequence"
privileges = ["USAGE", "SELECT"]
}
7 changes: 0 additions & 7 deletions database-grants/terraform/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ module "messaging_schema" {
}
}

module "query_schema" {
source = "./schemas/query"
providers = {
postgresql = postgresql.treetracker
}
}

module "stakeholder_schema" {
source = "./schemas/stakeholder"
providers = {
Expand Down
88 changes: 0 additions & 88 deletions database-grants/terraform/prod/schemas/query/main.tf

This file was deleted.

8 changes: 0 additions & 8 deletions database-grants/terraform/prod/schemas/query/provider.tf

This file was deleted.

0 comments on commit 64321c7

Please sign in to comment.