Search code examples
terraformtrim

how to remove double quotes of a variable using trim in terraform


  locals {
   check_list ="test" 
   trimoutput = trim(local.check_list, "")
} 

currently, the trim output value is still "test"

Expected output is just test. I need this value inside terraform code itself


Solution

  • if you want to include a literal quote mark then you must use a backslash key

    locals {
       check_list ="test" 
       trimoutput = trim(local.check_list, "\"")