Skip to content

Commit 6b38df4

Browse files
fix: update logic
Co-authored-by: Copilot <[email protected]>
1 parent 45171ec commit 6b38df4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
# 2. If admin_password is provided, that value is used (manage_admin_user_password must be false)
1919
# 3. If both are unset/false/empty, the module creates a random password
2020
create_password = local.enabled && var.admin_password == "" && !var.manage_admin_user_password
21-
admin_password = local.create_password ? one(random_password.admin_password[*].result) : var.admin_password
21+
admin_password = var.manage_admin_user_password ? null : (local.create_password ? one(random_password.admin_password[*].result) : var.admin_password)
2222

2323
admin_user = length(var.admin_user) > 0 ? var.admin_user : join("", random_pet.admin_user[*].id)
2424
database_name = length(var.database_name) > 0 ? var.database_name : join("", random_pet.database_name[*].id)

0 commit comments

Comments
 (0)