Skip to content

Replaces it with the updated list-compatible syntax #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 changes: 2 additions & 2 deletions src/modules/postgresql-user/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
enabled = module.this.enabled

db_user = length(var.db_user) > 0 ? var.db_user : var.service_name
db_password = length(var.db_password) > 0 ? var.db_password : join("", random_password.db_password.*.result)
db_password = length(var.db_password) > 0 ? var.db_password : join("", random_password.db_password[*].result)

save_password_in_ssm = local.enabled && var.save_password_in_ssm

Expand Down Expand Up @@ -45,7 +45,7 @@ resource "postgresql_role" "default" {
# Apply the configured grants to the user
resource "postgresql_grant" "default" {
count = local.enabled ? length(var.grants) : 0
role = join("", postgresql_role.default.*.name)
role = join("", postgresql_role.default[*].name)
database = var.grants[count.index].db
schema = var.grants[count.index].schema
object_type = var.grants[count.index].object_type
Expand Down
2 changes: 1 addition & 1 deletion src/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ output "additional_schemas" {
output "additional_grants" {
value = keys(module.additional_grants)
description = "Additional grants"
}
}
Loading