Skip to content

Commit

Permalink
Merge branch 'master' into like-postgres-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
partha04patel authored Jun 18, 2024
2 parents 1b7c4d2 + 493cb41 commit 9c673d1
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ terraform.tfvars
.terraform*
*.swp
password_file*
.vscode
.vscode
*.tfstate
*.backup
2 changes: 1 addition & 1 deletion database-grants/terraform/dev/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
44 changes: 44 additions & 0 deletions database-grants/terraform/dev/schemas/queue/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module "microservice_schema" {
source = "./../../modules/microservice_schema"
schema = "queue"
service_user_table_grants = ["SELECT", "INSERT", "UPDATE", "DELETE"]
}

resource "random_password" "s_password" {
length = 16
special = true
override_special = "_%@"
}

resource "postgresql_role" "service_user" {
name = "s_queue"
login = true
password = random_password.s_password.result
search_path = ["queue"]
}


resource "postgresql_grant" "service-user-usage" {
database = "treetracker"
role = "s_queue"
schema = "queue"
object_type = "schema"
privileges = ["USAGE", "CREATE"]
}

resource "postgresql_grant" "table-service-user" {
database = "treetracker"
role = "s_queue"
schema = "queue"
object_type = "table"
privileges = ["SELECT", "INSERT", "UPDATE", "DELETE"]
}

resource "postgresql_grant" "sequence-service-user" {
database = "treetracker"
role = "s_queue"
schema = "queue"
object_type = "sequence"
privileges = ["USAGE", "SELECT"]

}
8 changes: 8 additions & 0 deletions database-grants/terraform/dev/schemas/queue/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.22.0"
}
}
}
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/extra/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/schemas/airflow/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/schemas/query/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/schemas/regions/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/schemas/wallet/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/schemas/webmap/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.11.0"
version = "1.22.0"
}
}
}

0 comments on commit 9c673d1

Please sign in to comment.