diff --git a/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx b/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx index 3d5db2743..498eacc23 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx @@ -1,8 +1,8 @@ --- -page_title: alltrue - Functions - Configuration Language +page_title: alltrue function reference description: |- - The alltrue function determines whether all elements of a collection - are true or "true". If the collection is empty, it returns true. + The `alltrue` function returns `true` if all elements in a collection + are `true`, `"true"`, or if the collection is empty. Learn how to use the `alltrue` function in Packer templates. --- # `alltrue` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx b/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx index fb67069bd..020d6eb26 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx @@ -1,8 +1,8 @@ --- -page_title: anytrue - Functions - Configuration Language +page_title: anytrue function reference description: |- - The anytrue function determines whether any element of a collection - is true or "true". If the collection is empty, it returns false. + The `anytrue` function returns `true` if any element of a collection + is `true` or `"true"`. Learn how to use the `anytrue` function in Packer templates. --- # `anytrue` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx b/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx index 66658bfcd..cea128442 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx @@ -1,8 +1,8 @@ --- -page_title: chunklist - Functions - Configuration Language +page_title: chunklist function reference description: |- - The chunklist function splits a single list into fixed-size chunks, returning - a list of lists. + The `chunklist` function splits a single list into fixed-size chunks and returns + a list of lists. Learn how to use the `chunklist` function in Packer templates. --- # `chunklist` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx index f46673c49..d18b20311 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx @@ -1,8 +1,7 @@ --- -page_title: coalesce - Functions - Configuration Language +page_title: coalesce function reference description: |- - The coalesce function takes any number of arguments and returns the - first one that isn't null nor empty. + The `coalesce` function returns the first argument that is not empty or `null` from a list of arguments. Learn to use the `coalesce` function in Packer templates. --- # `coalesce` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx index 79d9d85c8..ea13ccb5c 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx @@ -1,8 +1,7 @@ --- -page_title: coalescelist - Functions - Configuration Language +page_title: coalescelist function reference description: |- - The coalescelist function takes any number of list arguments and returns the - first one that isn't empty. + The `coalescelist` function returns the first non-empty argument in a list of arguments. Learn how to use the `coalescelist` function in Packer templates. --- # `coalescelist` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx b/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx index df8b79e75..4938aace0 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx @@ -1,6 +1,6 @@ --- -page_title: compact - Functions - Configuration Language -description: The compact function removes empty string elements from a list. +page_title: compact function reference +description: The `compact` function removes empty string elements from a list. Learn how to use the `compact` function in Packer templates. --- # `compact` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx b/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx index 318b72fa0..365485fce 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx @@ -1,6 +1,6 @@ --- -page_title: concat - Functions - Configuration Language -description: The concat function combines two or more lists into a single list. +page_title: concat function reference +description: The `concat` function combines two or more lists into a single list. Learn how to use the `concat` function in Packer templates. --- # `concat` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx b/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx index 43cdd5c5d..f9892128c 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx @@ -1,6 +1,6 @@ --- -page_title: contains - Functions - Configuration Language -description: The contains function determines whether a list or set contains a given value. +page_title: contains function reference +description: The `contains` function determines whether a list or set contains a given value. Learn how to use the `contains` function in Packer templates. --- # `contains` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx b/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx index 28fe7a448..33dec1e1e 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx @@ -1,6 +1,6 @@ --- -page_title: distinct - Functions - Configuration Language -description: The distinct function removes duplicate elements from a list. +page_title: distinct function reference +description: The `distinct` function removes duplicate elements from a list. Learn how to use the `distince` function in Packer templates. --- # `distinct` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/element.mdx b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx index 6373cc394..178ecaf4d 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/element.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx @@ -1,6 +1,6 @@ --- -page_title: element - Functions - Configuration Language -description: The element function retrieves a single element from a list. +page_title: element function reference +description: The `element` function retrieves a single element from a list. Learn how to use the `element` function in Packer templates. --- # `element` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx index a3bc2f442..9aca98a0b 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx @@ -1,6 +1,6 @@ --- -page_title: flatten - Functions - Configuration Language -description: The flatten function eliminates nested lists from a list. +page_title: flatten function reference +description: The `flatten` function eliminates nested lists from a list. Learn how to use the `flatten` function in Packer templates. --- # `flatten` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx index 80c80ca05..e3d134301 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx @@ -1,6 +1,6 @@ --- -page_title: index - Functions - Configuration Language -description: The index function finds the element index for a given value in a list. +page_title: index function reference +description: The `index` function finds the element index for a given value in a list. Learn how to use the `index` function in Packer templates. --- # `index` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx index cd955f9df..5c9161389 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx @@ -1,6 +1,6 @@ --- -page_title: keys - Functions - Configuration Language -description: The keys function returns a list of the keys in a given map. +page_title: keys function reference +description: The `keys` function returns a list of keys in a given map. Learn how to use the `key` function in Packer templates. --- # `keys` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/length.mdx b/website/content/docs/templates/hcl_templates/functions/collection/length.mdx index 71eacc8dc..8fafc7c25 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/length.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/length.mdx @@ -1,6 +1,6 @@ --- -page_title: length - Functions - Configuration Language -description: The length function determines the length of a collection or string. +page_title: length function reference +description: The `length` function determines the length of a collection or string. Learn how to use the `length` function in Packer templates. --- # `length` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx index 0eb686063..f56f7dcb4 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx @@ -1,6 +1,6 @@ --- -page_title: lookup - Functions - Configuration Language -description: The lookup function retrieves an element value from a map given its key. +page_title: lookup function reference +description: The `lookup` function retrieves an element value from a map using the map key. Learn how to use the `lookup` function in Packer templates. --- # `lookup` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx b/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx index e6ac8b7a6..19c24d5cb 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx @@ -1,8 +1,7 @@ --- -page_title: merge - Functions - Configuration Language +page_title: merge function reference description: |- - The merge function takes an arbitrary number of maps and returns a single - map after merging the keys from each argument. + The `merge` function returns a single map by merging the keys in multiple maps. Learn how to use the `merge` function in Packer templates. --- # `merge` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/range.mdx b/website/content/docs/templates/hcl_templates/functions/collection/range.mdx index 9ddf0af0e..fe326dd5a 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/range.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/range.mdx @@ -1,6 +1,6 @@ --- -page_title: range - Functions - Configuration Language -description: The range function generates sequences of numbers. +page_title: range function reference +description: The `range` function generates sequences of numbers. Learn how to use the `range` function in Packer templates. --- # `range` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx index 743a97a5d..b844e6a71 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx @@ -1,6 +1,6 @@ --- -page_title: reverse - Functions - Configuration Language -description: The reverse function reverses a sequence. +page_title: reverse function reference +description: The `reverse` function reverses the values in a sequence. Learn how to use the `reverse` function in Packer templates. --- # `reverse` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx index 924b9a8b0..94411508a 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx @@ -1,16 +1,14 @@ --- -page_title: setintersection - Functions - Configuration Language +page_title: setintersection function reference description: |- - The setintersection function takes multiple sets and produces a single set - containing only the elements that all of the given sets have in common. + The `setintersection` function creates one set from multiple sets that contains only elements common to all input sets. Learn how to use `setintersection` in Packer templates. --- # `setintersection` Function The `setintersection` function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. -In other words, it computes the -[intersection]() of the sets. +The new set is referred to as the _intersection_. ```hcl setintersection(sets...) diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx index d9425f120..6ccea5cfc 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx @@ -1,8 +1,8 @@ --- -page_title: setproduct - Functions - Configuration Language +page_title: setproduct function reference description: |- - The setproduct function finds all of the possible combinations of elements - from all of the given sets by computing the cartesian product. + The `setproduct` function finds all possible combinations of elements + from the given sets. Learn how to use the `setproduct` function in Packer templates. --- # `setproduct` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx index a78e2d489..1a429627d 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx @@ -1,8 +1,7 @@ --- -page_title: setunion - Functions - Configuration Language +page_title: setunion function reference description: |- - The setunion function takes multiple sets and produces a single set - containing the elements from all of the given sets. + The `setunion` function creates one set containing the elements from multiple given sets. Learn how to use the `setunion` function in Packer templates. --- # `setunion` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx index f92ebc2ea..f230f4351 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx @@ -1,6 +1,6 @@ --- -page_title: slice - Functions - Configuration Language -description: The slice function extracts some consecutive elements from within a list. +page_title: slice function reference +description: The `slice` function extracts consecutive elements from a list. Learn how to use the `slice` function in Packer templates. --- # `slice` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx b/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx index edc3dd99f..78a55cbe3 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx @@ -1,8 +1,7 @@ --- -page_title: sort - Functions - Configuration Language +page_title: sort function reference description: |- - The sort function takes a list of strings and returns a new list with those - strings sorted lexicographically. + The `sort` function returns a new lexicographically sorted list from a list of strings. Learn how to use the `sort` function in Packer templates. --- # `sort` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/values.mdx b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx index 0fced24da..445cfdba4 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/values.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx @@ -1,6 +1,6 @@ --- -page_title: values - Functions - Configuration Language -description: The values function returns a list of the element values in a given map. +page_title: values function reference +description: The `values` function returns a list of the element values in a given map. Learn how to use the `values` function in Packer templates. --- # `values` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx b/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx index fbdcb6a75..a3ae79553 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx @@ -1,8 +1,8 @@ --- -page_title: zipmap - Functions - Configuration Language +page_title: zipmap function reference description: |- - The zipmap function constructs a map from a list of keys and a corresponding - list of values. + The `zipmap` function constructs a map from a list of keys and a corresponding + list of values. Learn how to use the `zipmap` function in Packer templates. --- # `zipmap` Function diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx index 73d5b06fc..543ca5ffe 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx @@ -1,8 +1,8 @@ --- -page_title: aws_secretsmanager - Functions - Configuration Language +page_title: aws_secretsmanager function reference description: >- - The aws_secretsmanager function retrieves secrets from Amazon secretsmanager - stores. + The `aws_secretsmanager` function retrieves secrets from Amazon Secrets Manager + stores. Learn how to use the `aws_secretsmanager` function in Packer templates. --- # `aws_secretsmanager` Function diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx index fff91894f..c091fca56 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx @@ -1,6 +1,6 @@ --- -page_title: consul - Functions - Configuration Language -description: The consul function retrieves secrets from HashiCorp consul KV stores. +page_title: consul function reference +description: The `consul` function retrieves secrets from HashiCorp Consul KV stores. Learn how to use the `consul` function in Packer templates. --- # `consul_key` Function diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx index 3749e899d..aa7696e27 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx @@ -1,21 +1,20 @@ --- -page_title: env - Functions - Configuration Language -description: The env function retrieves environment values for input variables. +page_title: env function reference +description: The `env` function retrieves environment values for input variables. Learn how to use the `env` function in Packer templates. --- # `env` Function +The `env` function gets the value for an environment variable inside input +variables. This is the only function that is callable from a `variable` +block. You can only use the `env` function in the default input. + ```hcl variable "aws_region" { default = env("AWS_DEFAULT_REGION") } ``` -`env` allows you to get the value for an environment variable inside input -variables _only_. This is the only function that is callable from a variable -block and it can only be used in the default input. `env` cannot be called from -other places. - In the previous example, the value of `aws_region` will be what's stored in the `AWS_DEFAULT_REGION` env var, unless aws_region is also set in a [manner that takes precedence](/packer/docs/templates/hcl_templates/variables#variable-definition-precedence). diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx index 8136a1011..b908c9c13 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx @@ -1,6 +1,6 @@ --- -page_title: vault - Functions - Configuration Language -description: The vault function retrieves secrets from HashiCorp Vault KV stores. +page_title: vault function reference +description: The `vault` function retrieves secrets from HashiCorp Vault KV stores. Learn how to use the `vault` function in Packer templates. --- # `vault` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx index c49779c2c..f7e6ceff0 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx @@ -1,8 +1,8 @@ --- -page_title: bcrypt - Functions - Configuration Language +page_title: bcrypt function reference description: |- - The bcrypt function computes a hash of the given string using the Blowfish - cipher. + The `bcrypt` function computes a hash of the given string using the Blowfish + cipher. Learn how to use the `bcrypt` function in Packer templates. --- # `bcrypt` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx index f777aa65d..0db691adf 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx @@ -1,8 +1,8 @@ --- -page_title: md5 - Functions - Configuration Language +page_title: md5 function reference description: |- - The md5 function computes the MD5 hash of a given string and encodes it - with hexadecimal digits. + The `md5` function computes the MD5 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `md5` function in Packer templates. --- # `md5` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx index 59339c651..7e4a5ad84 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx @@ -1,6 +1,6 @@ --- -page_title: rsadecrypt - Functions - Configuration Language -description: The rsadecrypt function decrypts an RSA-encrypted message. +page_title: rsadecrypt function reference +description: The `rsadecrypt` function decrypts an RSA-encrypted message. Learn how to usethe `rsadecrypt` function in Packer templates. --- # `rsadecrypt` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx index a001654fa..c0cc5cd63 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx @@ -1,8 +1,8 @@ --- -page_title: sha1 - Functions - Configuration Language +page_title: sha1 function reference description: |- - The sha1 function computes the SHA1 hash of a given string and encodes it - with hexadecimal digits. + The `sha1` function computes the SHA1 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `sha1` function in Packer templates. --- # `sha1` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx index 06133dba3..3abec6bb5 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx @@ -1,8 +1,8 @@ --- -page_title: sha256 - Functions - Configuration Language +page_title: sha256 function reference description: |- - The sha256 function computes the SHA256 hash of a given string and encodes it - with hexadecimal digits. + The `sha256` function computes the SHA256 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `sha256` function in Packer templates. --- # `sha256` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx index 3d58ecf90..3a8cfeaca 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx @@ -1,8 +1,8 @@ --- -page_title: sha512 - Functions - Configuration Language +page_title: sha512 function reference description: |- - The sha512 function computes the SHA512 hash of a given string and encodes it - with hexadecimal digits. + The `sha512` function computes the SHA512 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `sha512` function in Packer templates. --- # `sha512` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx index 708b6a684..1cc091cd8 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx @@ -1,6 +1,6 @@ --- -page_title: formatdate - Functions - Configuration Language -description: The formatdate function converts a timestamp into a different time format. +page_title: formatdate function reference +description: The `formatdate` function converts a timestamp into a specified time format. Learn how to use `formatdate` functions in Packer templates. --- # `formatdate` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx index 37217a5f4..b52e9805c 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx @@ -1,8 +1,8 @@ --- -page_title: legacy_isotime - Functions - Configuration Language +page_title: legacy_isotime function reference description: |- - The legacy_isotime function returns a string representation of the current date - and time. + The `legacy_isotime` function returns a string representation of the current date + and time. Learn how to use the `legacy_isotime` function in Packer templates. --- # `legacy_isotime` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx index c99331507..262c4a6c7 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx @@ -1,8 +1,8 @@ --- -page_title: legacy_strftime - Functions - Configuration Language +page_title: legacy_strftime function reference description: |- - The legacy_strftime function returns a string representation of the current date - and time. + The `legacy_strftime` function returns a string representation of the current date + and time. Learn how to use the `legacy_strftime` function in Packer templates. --- # `legacy_strftime` — UTC time, formated using the ISO C standard format diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx index 0a19c566b..d54847bde 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx @@ -1,8 +1,8 @@ --- -page_title: timeadd - Functions - Configuration Language +page_title: timeadd function reference description: |- - The timeadd function adds a duration to a timestamp, returning a new - timestamp. + The `timeadd` function adds time to a timestamp and returns a new + timestamp. Learn how to use the `timeadd` function in Packer templates. --- # `timeadd` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx index b27eb1123..ce31a973d 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx @@ -1,8 +1,8 @@ --- -page_title: timestamp - Functions - Configuration Language +page_title: timestamp function reference description: |- - The timestamp function returns a string representation of the current date - and time. + The `timestamp` function returns a string representation of the current date + and time. Learn how to use the `timestamp` function in Packer templates. --- # `timestamp` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx index b9c28ca97..87c8074c4 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx @@ -1,6 +1,6 @@ --- -page_title: abspath - Functions - Configuration Language -description: The abspath function converts the argument to an absolute filesystem path. +page_title: abspath function reference +description: The `abspath` function converts an argument to an absolute filesystem path. Learn how to use the `abspath` function in Packer templates. --- # `abspath` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/basename.mdx b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx index 70a05e08a..4ed4df133 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/basename.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx @@ -1,8 +1,7 @@ --- -page_title: basename - Functions - Configuration Language +page_title: basename function reference description: |- - The basename function removes all except the last portion from a filesystem - path. + The `basename` function removes parts of a filesystem path except for the last portion. Learn how to use the `basename` function in Packer templates. --- # `basename` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx index 348c0363a..b76b056ba 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx @@ -1,6 +1,6 @@ --- -page_title: dirname - Functions - Configuration Language -description: The dirname function removes the last portion from a filesystem path. +page_title: dirname function reference +description: The `dirname` function removes the last portion from a filesystem path. Learn how to use the `dirname` function in Packer templates. --- # `dirname` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/file.mdx b/website/content/docs/templates/hcl_templates/functions/file/file.mdx index 6dd36ee3a..873ecd8a4 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/file.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/file.mdx @@ -1,8 +1,7 @@ --- -page_title: file - Functions - Configuration Language +page_title: file function reference description: |- - The file function reads the contents of the file at the given path and - returns them as a string. + The `file` function reads the contents of a file and returns it as a string. Learn how to use the `file` function in Packer templates. --- # `file` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx index b8b0b3fe2..6d4f302d3 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx @@ -1,6 +1,6 @@ --- -page_title: fileexists - Functions - Configuration Language -description: The fileexists function determines whether a file exists at a given path. +page_title: fileexists function reference +description: The `fileexists` function determines whether a file exists at a given path. Learn how to use the `fileexists` function in Packer templates. --- # `fileexists` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx index e60dd126d..da6d44ece 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx @@ -1,6 +1,6 @@ --- -page_title: fileset - Functions - Configuration Language -description: The fileset function enumerates a set of regular file names given a pattern. +page_title: fileset function reference +description: The `fileset` function enumerates a set of regular file names according to a pattern. Learn how to use the `fileset` function in Packer templates. --- # `fileset` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx b/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx index 974716c8f..77db1db8d 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx @@ -1,8 +1,8 @@ --- -page_title: pathexpand - Functions - Configuration Language +page_title: pathexpand function reference description: |- - The pathexpand function expands a leading ~ character to the current user's - home directory. + The `pathexpand` function replaces a leading tilde `~` character with the current user's + home directory. Learn how to use the `pathexpand` function in Packer templates. --- # `pathexpand` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx index 68cc8cf47..1a5707cc6 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx @@ -1,26 +1,21 @@ --- -page_title: templatefile - Functions - Configuration Language +page_title: templatefile function reference description: |- - The templatefile function reads the file at the given path and renders its - content as a template using a supplied set of template variables. + The `templatefile` function reads a file and renders its + content as a template using a set of template variables. Learn how to use the `templatefile` function. --- # `templatefile` Function --> _Recommendation:_ we recommend using the `.pkrtpl.hcl` file extension when -using the `templatefile` function. Template files _are_ hcl treated as files but -also templates and therefore have slightly different set of features -than the ones offered in a `.pkr.hcl` Packer template. While you are not -required to use this extension, doing so will enable syntax highlighters to -properly understand your file. - -`templatefile` reads the file at the given path and renders its content as a +The `templatefile` function reads the file at the given path and renders its content as a template using a supplied set of template variables. ```hcl templatefile(path, vars) ``` +We recommend using the `.pkrtpl.hcl` file extension when using the `templatefile` function to create templates. Packer treats HCL templates as combination of file and template. As a result, HCL template files have slightly different set of features than the templates with a `.pkr.hcl` extension. Using the `.pkr.hcl` extension also enables syntax highlighters to properly understand your file. + The template syntax is the same as for string templates in the main HCL2 language, including interpolation sequences delimited with `${ ... }`. This function just allows longer template sequences to be factored out into a