1 parent
64be99308b
commit
5cba142003
38 files changed
+565
-353
No files matched your search
@@ -0,0 +1,12 @@
|
||||
resource "random_password" "this" {
|
||||
length = 32
|
||||
special = false
|
||||
}
|
||||
|
||||
resource "postgresql_role" "this" {
|
||||
name = var.role
|
||||
login = true
|
||||
password = random_password.this.result
|
||||
roles = [var.owner]
|
||||
assume_role = var.owner
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
output "username" {
|
||||
value = postgresql_role.this.name
|
||||
}
|
||||
|
||||
output "password" {
|
||||
value = random_password.this.result
|
||||
sensitive = true
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
variable "role" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "owner" {
|
||||
type = string
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
postgresql = {
|
||||
source = "cyrilgdn/postgresql"
|
||||
version = ">= 1.27.0"
|
||||
}
|
||||
random = {
|
||||
source = "hashicorp/random"
|
||||
version = ">= 3.9.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user