Merge pull request #13283 from hashicorp/docs/packer-seo-templates-batch2

packer-seo-templates-batch2
docs/packer-seo-final-batch
trujillo-adam 1 year ago committed by GitHub
commit 88478059d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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](<https://en.wikipedia.org/wiki/Intersection_(set_theory)>) of the sets.
The new set is referred to as the _intersection_.
```hcl
setintersection(sets...)

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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).

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save