quorate/terraform/internal/postgres/hf-chat-ui.tf

25 lines
569 B
HCL

resource "random_password" "hf_chat_ui" {
length = 32
special = false
}
resource "postgresql_role" "hf_chat_ui" {
name = "hf_chat_ui"
login = true
password = random_password.hf_chat_ui.result
lifecycle {
ignore_changes = [password]
}
}
resource "postgresql_database" "hf_chat_ui" {
name = "hf_chat_ui"
owner = postgresql_role.hf_chat_ui.name
}
resource "postgresql_grant_role" "hf_rotation" {
role = postgresql_role.vault_db_admin.name
grant_role = postgresql_role.hf_chat_ui.name
with_admin_option = true
}