code: func MakeFileFunc(baseDir string, encBase64 bool) function.Function {
  	return function.New(&function.Spec{
  		Params: []function.Parameter{
  			{
  				Name: "path",
  				Type: cty.String,
  			},
  		},
  		Type: function.StaticReturnType(cty.String),
  		Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) {
  			path := args[0].AsString()
  			src, err := readFileBytes(baseDir, path)
  			if err != nil {
  				return cty.UnknownVal(cty.String), err
  			}
  
  			switch {
  			case encBase64:
  				enc := base64.StdEncoding.EncodeToString(src)
  				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; 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
  			}
  		},
  	})
  }
docs: // MakeFileFunc constructs a function that takes a file path and returns the
  // contents of that file, either directly as a string (where valid UTF-8 is
  // required) or as a string containing base64 bytes.