Skip to content

Commit

Permalink
fix: allow commas by escaping in notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode authored Jun 18, 2024
1 parent 17ef61d commit 207d3ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ resource "null_resource" "default" {
) : "",
try(length(each.value["note"]["text"]), 0) > 0 || length(var.note_suffix) > 0 ? format(
"--note Text=\"%s%s\",UpdatedBy=\"%s\"",
replace(each.value["note"]["text"], "\"", "'"),
# escape commas and escape double quotations
replace(replace(each.value["note"]["text"], ",", "\\,"), "\"", "'"),
var.note_suffix,
coalesce(each.value["note"]["updated_by"], var.default_note_updated_by)
) : "",
Expand Down Expand Up @@ -80,4 +81,4 @@ resource "null_resource" "default" {

# output "result" {
# value = module.current_desired_capacity
# }
# }

0 comments on commit 207d3ac

Please sign in to comment.