Refactor all_services to remove name attribute
This commit is contained in:
parent
6f9f888478
commit
1d14ac888e
16 changed files with 42 additions and 71 deletions
modules/services
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue