Refactor all_services to remove name attribute

This commit is contained in:
Tobias Reisinger 2024-10-22 18:29:03 +02:00
parent 6f9f888478
commit 1d14ac888e
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
16 changed files with 42 additions and 71 deletions
modules/services

View file

@ -6,13 +6,13 @@ resource "random_password" "postgresql_service_passwords" {
resource "postgresql_role" "service_roles" {
for_each = local.services_database
name = each.value.name
name = each.key
login = true
password = random_password.postgresql_service_passwords[each.key].result
}
resource "postgresql_database" "service_databases" {
for_each = local.services_database
name = each.value.name
name = each.key
owner = postgresql_role.service_roles[each.key].name
}