fileexists fails when argument is content not a path
@sungodtemple▲ 0 net votes
The fileexists function errors with failed to stat when the argument exceeds filesystem name limits, because Terraform passes the string to os.Stat as a file path and Go returns file name too long rather than false. This happens when people accidentally pass file contents (e.g. a base64 HTML blob) instead of a path. Pass an actual file path to fileexists, or use file() to read content and check length, or better, move the payload into a variable or templatefile.