From 398fe8652df7e10ecd7898fc51f2dd61e65cdccb Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 13 Mar 2019 13:43:58 -0400 Subject: [PATCH] config: Mention other file hashing functions when file() detects unsupported contents Reference: https://github.com/hashicorp/terraform/issues/20664 --- lang/funcs/filesystem.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/funcs/filesystem.go b/lang/funcs/filesystem.go index 617b891b9..ed8a9d1bc 100644 --- a/lang/funcs/filesystem.go +++ b/lang/funcs/filesystem.go @@ -40,7 +40,7 @@ func MakeFileFunc(baseDir string, encBase64 bool) function.Function { return cty.StringVal(enc), nil default: if !utf8.Valid(src) { - return cty.UnknownVal(cty.String), fmt.Errorf("contents of %s are not valid UTF-8; to read arbitrary bytes, use the filebase64 function instead", path) + return cty.UnknownVal(cty.String), fmt.Errorf("contents of %s are not valid UTF-8; use the filebase64 function to obtain the Base64 encoded contents or the other file functions (e.g. filemd5, filesha256) to obtain file hashing results instead", path) } return cty.StringVal(string(src)), nil }