With a value such as:
s = "https://xxx.yyy.com/oauth2/v1/token?grant_type=client_zzzz"
Terraform complains, when try to escape the embedded =. Seemingly, it has no issue, with certain other special chars, such as ?.
Aside from direct escape (\), I also tried format(), with various modifiers. No luck....
If I just use the native format to assign, it renders the value as: =
used a direct escape \=, within the string, and, also the format""%s", var).
This will replace all occurrences of '=' with '=' in your string 's'. You can use similar approach for other special characters as well.