Skip to content

Commit

Permalink
feat: Automate Postgreql password auth
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmoore-nc committed Dec 10, 2024
1 parent 4216dc8 commit 81503f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infrastructure/modules/postgresql-flexible/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "azurerm_postgresql_flexible_server" "postgresql_flexible_server" {
}

administrator_login = length(var.administrator_login) > 0 && var.password_auth_enabled ? var.administrator_login : null
administrator_password = length(var.administrator_login) > 0 && var.password_auth_enabled ? random_password.admin_password[0] : null
administrator_password = length(var.administrator_login) > 0 && var.password_auth_enabled ? random_password.admin_password[0].result : null

# Postgres Flexible Server does not support User Assigned Identity
# so do not enable for now. If required, create the identity in an
Expand All @@ -45,7 +45,7 @@ resource "azurerm_key_vault_secret" "db_admin_pwd" {
count = length(var.administrator_login) > 0 && var.password_auth_enabled ? 1 : 0

name = var.key_vault_admin_pwd_secret_name
value = resource.random_password.admin_password
value = resource.random_password.admin_password[0].result
key_vault_id = var.key_vault_admin_pwd_secret_name
}

Expand Down

0 comments on commit 81503f3

Please sign in to comment.