terraform/website/docs/configuration/functions
Martin Atkins 954d38e870 lang: New file-hashing functions
In prior versions, we recommended using hash functions in conjunction with
the file function as an idiom for detecting changes to upstream blobs
without fetching and comparing the whole blob.

That approach relied on us being able to return raw binary data from
file(...). Since Terraform strings pass through intermediate
representations that are not binary-safe (e.g. the JSON state), there was
a risk of string corruption in prior versions which we have avoided for
0.12 by requiring that file(...) be used only with UTF-8 text files.

The specific case of returning a string and immediately passing it into
another function was not actually subject to that corruption risk, since
the HIL interpreter would just pass the string through verbatim, but this
is still now forbidden as a result of the stricter handling of file(...).

To avoid breaking these use-cases, here we introduce variants of the hash
functions a with "file" prefix that take a filename for a disk file to
hash rather than hashing the given string directly. The configuration
upgrade tool also now includes a rule to detect the documented idiom and
rewrite it into a single function call for one of these new functions.

This does cause a bit of function sprawl, but that seems preferable to
introducing more complex rules for when file(...) can and cannot read
binary files, making the behavior of these various functions easier to
understand in isolation.
2019-01-25 10:18:44 -08:00
..
abs.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
base64decode.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
base64encode.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
base64gzip.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
base64sha256.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
base64sha512.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
basename.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
bcrypt.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
ceil.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
chomp.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
chunklist.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
cidrhost.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
cidrnetmask.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
cidrsubnet.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
coalesce.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
coalescelist.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
compact.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
contains.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
csvdecode.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
dirname.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
distinct.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
element.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
file.html.md lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
filebase64.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
filebase64sha256.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
filebase64sha512.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
fileexists.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
filemd5.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
filesha1.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
filesha256.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
filesha512.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
flatten.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
floor.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
format.html.md lang: Add "formatdate" function 2019-01-07 09:10:14 -08:00
formatdate.html.md lang: Add "formatdate" function 2019-01-07 09:10:14 -08:00
formatlist.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
indent.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
index.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
join.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
jsondecode.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
jsonencode.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
keys.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
length.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
list.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
log.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
lookup.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
lower.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
map.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
matchkeys.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
max.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
md5.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
merge.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
min.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
pathexpand.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
pow.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
replace.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
rsadecrypt.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
sethaselement.html.md lang/functions: set functions from cty 2019-01-16 09:57:16 -08:00
setintersection.html.md lang/functions: set functions from cty 2019-01-16 09:57:16 -08:00
setproduct.html.md lang/functions: set functions from cty 2019-01-16 09:57:16 -08:00
setunion.html.md lang/functions: set functions from cty 2019-01-16 09:57:16 -08:00
sha1.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
sha256.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
sha512.html.md lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
signum.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
slice.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
sort.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
split.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
substr.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
templatefile.html.md lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
timeadd.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
timestamp.html.md lang: Add "formatdate" function 2019-01-07 09:10:14 -08:00
title.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
tobool.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
tolist.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
tomap.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
tonumber.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
toset.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
tostring.html.md lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
transpose.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
trimspace.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
upper.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
urlencode.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
uuid.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
values.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00
zipmap.html.md website: Update functions section page titles 2018-12-20 14:20:42 -08:00