ce7cb702218693d08ea6d83464d2457c9250027c
This commit is contained in:
commit
34c5f8963c
1 changed files with 145336 additions and 0 deletions
26
terraform/internal/postgres/argo.tf
Normal file
26
terraform/internal/postgres/argo.tf
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
resource "random_password" "argo" {
|
||||
length = 32
|
||||
special = false
|
||||
}
|
||||
|
||||
resource "postgresql_role" "argo" {
|
||||
name = "argo"
|
||||
login = true
|
||||
password = random_password.argo.result
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [password]
|
||||
}
|
||||
}
|
||||
|
||||
resource "postgresql_database" "argo" {
|
||||
name = "argo"
|
||||
owner = postgresql_role.argo.name
|
||||
}
|
||||
|
||||
# Allows vault_db_admin to ALTER ROLE argo PASSWORD '...' for credential rotation.
|
||||
resource "postgresql_grant_role" "vault_db_admin_argo" {
|
||||
role = postgresql_role.vault_db_admin.name
|
||||
grant_role = postgresql_role.argo.name
|
||||
with_admin_option = true
|
||||
}
|
||||
Loading…
Reference in a new issue