I am running some commands on my ec2 using remote-exec provisioner in my terraform file. But I am stuck at escaping special characters in a command. This code portion is from my main.tf file inside remote-exec provisioner portion. The error coming in terraform is "Invalid character" and "Invalid multi-line string". I wanted correct string sequence, so that these commands can execute on my ec2.
"VAR=$(cat contents.txt | grep '"token"'),
"VAR="${VAR:11}"",
"VAR="${VAR:0:-1}"",