Skip to content

Commit

Permalink
Replaces it with the updated list-compatible syntax (#10)
Browse files Browse the repository at this point in the history
* Replaces it with the updated list-compatible syntax

* local testing of terratest

* local testing of terratest

* local testing of terratest

* local testing of terratest

* local testing of terratest

* updating hello world test

* dropping the test due to its not following the testing pattern
  • Loading branch information
Musthaq101 authored Jan 6, 2025
1 parent 6e9ed85 commit 4bc7180
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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"
}
}

0 comments on commit 4bc7180

Please sign in to comment.