terraform/website/docs/configuration/functions
Martin Atkins cec4578005 lang/funcs: Experimental "defaults" function
This is a new part of the existing module_variable_optional_attrs
experiment, because it's intended to complement the ability to declare
an input variable whose type constraint is an object type with optional
attributes. Module authors can use this to replace null values (that were
either explicitly set or implied by attribute omission) with other
non-null values of the same type.

This function is a bit more type-fussy than our functions typically are
because it's intended for use primarily with input variables that have
fully-specified type constraints, and thus it uses that type information
to help inform how the defaults data structure should be interpreted.

Other uses of this function will probably be harder today because it takes
a lot of extra annotation to build a value of a specific type if it isn't
passing through a variable type constraint. Perhaps later language
features for more general type conversion will make this more applicable,
but for now the more general form of this problem is better solved other
ways.
2020-11-13 17:27:20 -08:00
..
abs.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
abspath.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
alltrue.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
anytrue.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
base64decode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
base64encode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
base64gzip.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
base64sha256.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
base64sha512.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
basename.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
bcrypt.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
can.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
ceil.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
chomp.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
chunklist.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
cidrhost.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
cidrnetmask.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
cidrsubnet.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
cidrsubnets.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
coalesce.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
coalescelist.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
compact.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
concat.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
contains.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
csvdecode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
defaults.html.md lang/funcs: Experimental "defaults" function 2020-11-13 17:27:20 -08:00
dirname.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
distinct.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
element.html.md Merge pull request #26723 from hashicorp/oct20_language_and_cli_docs 2020-11-11 19:31:05 -08:00
file.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
filebase64.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
filebase64sha256.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
filebase64sha512.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
fileexists.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
filemd5.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
fileset.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
filesha1.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
filesha256.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
filesha512.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
flatten.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
floor.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
format.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
formatdate.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
formatlist.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
indent.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
index.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
join.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
jsondecode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
jsonencode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
keys.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
length.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
list.html.md Merge pull request #26723 from hashicorp/oct20_language_and_cli_docs 2020-11-11 19:31:05 -08:00
log.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
lookup.html.md Merge pull request #26723 from hashicorp/oct20_language_and_cli_docs 2020-11-11 19:31:05 -08:00
lower.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
map.html.md Merge pull request #26723 from hashicorp/oct20_language_and_cli_docs 2020-11-11 19:31:05 -08:00
matchkeys.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
max.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
md5.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
merge.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
min.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
parseint.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
pathexpand.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
pow.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
range.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
regex.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
regexall.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
replace.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
reverse.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
rsadecrypt.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
setintersection.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
setproduct.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
setsubtract.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
setunion.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
sha1.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
sha256.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
sha512.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
signum.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
slice.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
sort.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
split.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
strrev.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
substr.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
sum.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
templatefile.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
textdecodebase64.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
textencodebase64.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
timeadd.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
timestamp.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
title.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
tobool.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
tolist.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
tomap.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
tonumber.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
toset.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
tostring.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
transpose.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
trim.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
trimprefix.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
trimspace.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
trimsuffix.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
try.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
upper.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
urlencode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
uuid.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
uuidv5.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
values.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
yamldecode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
yamlencode.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00
zipmap.html.md website: Adopt a ton of pages into the "language" layout 2020-10-26 18:19:26 -07:00