fix(windows-rdp): properly escape username and password in patch file (#xxx)

- Updated the `patch_file_contents` to use `jsonencode` for `CODER_USERNAME` and `CODER_PASSWORD` to preserve special characters.
This commit is contained in:
DevelopmentCats 2025-05-22 19:32:42 +00:00
parent afa23b8d3c
commit 02b5ae42f1

View File

@ -52,8 +52,9 @@ resource "coder_script" "windows-rdp" {
# doesn't allow recursive calls to the templatefile function. Have to feed
# results of the JS template replace into the powershell template
patch_file_contents = templatefile("${path.module}/devolutions-patch.js", {
CODER_USERNAME = var.admin_username
CODER_PASSWORD = var.admin_password
# Properly escape the username and password to preserve special characters
CODER_USERNAME = jsonencode(var.admin_username)
CODER_PASSWORD = jsonencode(var.admin_password)
})
})