change markdown references to new pathing
This commit is contained in:
parent
cca3109755
commit
1cb9aea752
|
@ -9,7 +9,7 @@
|
|||
[GH-10377]
|
||||
* **New function** `env` allows users to set the default value of a variable to
|
||||
the value of an environment variable. Please see [env function
|
||||
docs](https://www.packer.io/docs/from-1.5/functions/contextual/env") for
|
||||
docs](https://www.packer.io//docs/templates/hcl_templates/functions/contextual/env") for
|
||||
more details. [GH-10240]
|
||||
* **Future Scaffolding** This release contains a large number of no-op
|
||||
refactoring changes. The Packer team at HashiCorp is preparing to split the
|
||||
|
|
|
@ -153,7 +153,7 @@ type AlicloudImageConfig struct {
|
|||
AlicloudImageTags map[string]string `mapstructure:"tags" required:"false"`
|
||||
// Same as [`tags`](#tags) but defined as a singular repeatable block
|
||||
// containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
AlicloudImageTag config.KeyValues `mapstructure:"tag" required:"false"`
|
||||
AlicloudDiskDevices `mapstructure:",squash"`
|
||||
|
|
|
@ -167,7 +167,7 @@ type Config struct {
|
|||
RootVolumeTags map[string]string `mapstructure:"root_volume_tags" required:"false"`
|
||||
// Same as [`root_volume_tags`](#root_volume_tags) but defined as a
|
||||
// singular block containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
RootVolumeTag config.KeyValues `mapstructure:"root_volume_tag" required:"false"`
|
||||
// Whether or not to encrypt the volumes that are *launched*. By default, Packer will keep
|
||||
|
|
|
@ -52,7 +52,7 @@ type AMIConfig struct {
|
|||
AMITags map[string]string `mapstructure:"tags" required:"false"`
|
||||
// Same as [`tags`](#tags) but defined as a singular repeatable block
|
||||
// containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
AMITag config.KeyValues `mapstructure:"tag" required:"false"`
|
||||
// Enable enhanced networking (ENA but not SriovNetSupport) on
|
||||
|
@ -142,7 +142,7 @@ type AMIConfig struct {
|
|||
SnapshotTags map[string]string `mapstructure:"snapshot_tags" required:"false"`
|
||||
// Same as [`snapshot_tags`](#snapshot_tags) but defined as a singular
|
||||
// repeatable block containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
SnapshotTag config.KeyValues `mapstructure:"snapshot_tag" required:"false"`
|
||||
// A list of account IDs that have
|
||||
|
|
|
@ -204,7 +204,7 @@ type RunConfig struct {
|
|||
RunTags map[string]string `mapstructure:"run_tags" required:"false"`
|
||||
// Same as [`run_tags`](#run_tags) but defined as a singular repeatable
|
||||
// block containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
RunTag config.KeyValues `mapstructure:"run_tag" required:"false"`
|
||||
// The ID (not the name) of the security
|
||||
|
@ -319,7 +319,7 @@ type RunConfig struct {
|
|||
SpotTags map[string]string `mapstructure:"spot_tags" required:"false"`
|
||||
// Same as [`spot_tags`](#spot_tags) but defined as a singular repeatable block
|
||||
// containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
SpotTag config.KeyValues `mapstructure:"spot_tag" required:"false"`
|
||||
// Filters used to populate the `subnet_id` field.
|
||||
|
|
|
@ -58,7 +58,7 @@ type Config struct {
|
|||
VolumeRunTags map[string]string `mapstructure:"run_volume_tags"`
|
||||
// Same as [`run_volume_tags`](#run_volume_tags) but defined as a singular
|
||||
// block containing a `name` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
|
||||
// [`dynamic_block`](https://packer.io/docs/templates/hcl_templates/expressions.html#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
VolumeRunTag config.NameValues `mapstructure:"run_volume_tag" required:"false"`
|
||||
// Relevant only to Windows guests: If you set this flag, we'll add clauses
|
||||
|
|
|
@ -64,7 +64,7 @@ type Config struct {
|
|||
VolumeRunTags map[string]string `mapstructure:"run_volume_tags"`
|
||||
// Same as [`run_volume_tags`](#run_volume_tags) but defined as a singular
|
||||
// block containing a `name` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
|
||||
// [`dynamic_block`](https://packer.io/docs/templates/hcl_templates/expressions.html#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
VolumeRunTag config.NameValues `mapstructure:"run_volume_tag" required:"false"`
|
||||
// what architecture to use when registering the
|
||||
|
|
|
@ -17,7 +17,7 @@ type BlockDevice struct {
|
|||
Tags map[string]string `mapstructure:"tags" required:"false"`
|
||||
// Same as [`tags`](#tags) but defined as a singular repeatable block
|
||||
// containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
Tag config.KeyValues `mapstructure:"tag" required:"false"`
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ type Config struct {
|
|||
// Same as [`run_volume_tags`](#run_volume_tags) but defined as a singular
|
||||
// repeatable block containing a `key` and a `value` field. In HCL2 mode
|
||||
// the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
VolumeRunTag config.KeyValues `mapstructure:"run_volume_tag"`
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ type Config struct {
|
|||
AzureTags map[string]string `mapstructure:"azure_tags" required:"false"`
|
||||
// Same as [`azure_tags`](#azure_tags) but defined as a singular repeatable block
|
||||
// containing a `name` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
AzureTag config.NameValues `mapstructure:"azure_tag" required:"false"`
|
||||
// Resource group under which the final artifact will be stored.
|
||||
|
|
|
@ -64,7 +64,7 @@ type Config struct {
|
|||
ImageTags map[string]string `mapstructure:"image_tags" required:"false"`
|
||||
// Same as [`image_tags`](#image_tags) but defined as a singular repeatable
|
||||
// block containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
ImageTag config.KeyValues `mapstructure:"image_tag" required:"false"`
|
||||
// The service of the resulting image.
|
||||
|
@ -77,7 +77,7 @@ type Config struct {
|
|||
VmTags map[string]string `mapstructure:"vm_tags" required:"false"`
|
||||
// Same as [`vm_tags`](#vm_tags) but defined as a singular repeatable block
|
||||
// containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
VmTag config.NameValues `mapstructure:"vm_tag" required:"false"`
|
||||
// The name of the created disk.
|
||||
|
|
|
@ -89,7 +89,7 @@ type TencentCloudRunConfig struct {
|
|||
RunTags map[string]string `mapstructure:"run_tags" required:"false"`
|
||||
// Same as [`run_tags`](#run_tags) but defined as a singular repeatable
|
||||
// block containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
RunTag config.KeyValues `mapstructure:"run_tag" required:"false"`
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ type SourceMachineConfig struct {
|
|||
MachineTags map[string]string `mapstructure:"source_machine_tags" required:"false"`
|
||||
// Same as [`source_machine_tags`](#source_machine_tags) but defined as a
|
||||
// singular block containing a `key` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
MachineTag config.KeyValues `mapstructure:"source_machine_tag" required:"false"`
|
||||
// Whether or not the firewall
|
||||
|
|
|
@ -39,7 +39,7 @@ type TargetImageConfig struct {
|
|||
ImageTags map[string]string `mapstructure:"image_tags" required:"false"`
|
||||
// Same as [`image_tags`](#image_tags) but defined as a singular repeatable
|
||||
// block containing a `name` and a `value` field. In HCL2 mode the
|
||||
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
|
||||
// [`dynamic_block`](/docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
ImageTag config.NameValues `mapstructure:"image_tag" required:"false"`
|
||||
}
|
||||
|
|
|
@ -72,23 +72,23 @@ const (
|
|||
# All generated input variables will be of 'string' type as this is how Packer JSON
|
||||
# views them; you can change their type later on. Read the variables type
|
||||
# constraints documentation
|
||||
# https://www.packer.io/docs/from-1.5/variables#type-constraints for more info.
|
||||
# https://www.packer.io//docs/templates/hcl_templates/variables#type-constraints for more info.
|
||||
`
|
||||
|
||||
packerBlockHeader = `
|
||||
# See https://www.packer.io/docs/from-1.5/blocks/packer for more info
|
||||
# See https://www.packer.io//docs/templates/hcl_templates/blocks/packer for more info
|
||||
`
|
||||
|
||||
sourcesHeader = `
|
||||
# source blocks are generated from your builders; a source can be referenced in
|
||||
# build blocks. A build block runs provisioner and post-processors on a
|
||||
# source. Read the documentation for source blocks here:
|
||||
# https://www.packer.io/docs/from-1.5/blocks/source`
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/source`
|
||||
|
||||
buildHeader = `
|
||||
# a build block invokes sources and runs provisioning steps on them. The
|
||||
# documentation for build blocks can be found here:
|
||||
# https://www.packer.io/docs/from-1.5/blocks/build
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/build
|
||||
build {
|
||||
`
|
||||
)
|
||||
|
@ -343,44 +343,44 @@ func transposeTemplatingCalls(s []byte) []byte {
|
|||
return "", UnhandleableArgumentError{
|
||||
"lower",
|
||||
"`lower(var.example)`",
|
||||
"https://www.packer.io/docs/from-1.5/functions/string/lower",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/lower",
|
||||
}
|
||||
},
|
||||
"upper": func(_ string) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"upper",
|
||||
"`upper(var.example)`",
|
||||
"https://www.packer.io/docs/from-1.5/functions/string/upper",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/upper",
|
||||
}
|
||||
},
|
||||
"split": func(_, _ string, _ int) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"split",
|
||||
"`split(separator, string)`",
|
||||
"https://www.packer.io/docs/from-1.5/functions/string/split",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/split",
|
||||
}
|
||||
},
|
||||
"replace": func(_, _, _ string, _ int) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"replace",
|
||||
"`replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`",
|
||||
"https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
}
|
||||
},
|
||||
"replace_all": func(_, _, _ string) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"replace_all",
|
||||
"`replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`",
|
||||
"https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
}
|
||||
},
|
||||
"clean_resource_name": func(_ string) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"clean_resource_name",
|
||||
"use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`",
|
||||
"https://packer.io/docs/from-1.5/variables#custom-validation-rules" +
|
||||
" , https://www.packer.io/docs/from-1.5/functions/string/replace" +
|
||||
" or https://www.packer.io/docs/from-1.5/functions/string/regex_replace",
|
||||
"https://packer.io//docs/templates/hcl_templates/variables#custom-validation-rules" +
|
||||
" , https://www.packer.io//docs/templates/hcl_templates/functions/string/replace" +
|
||||
" or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
}
|
||||
},
|
||||
"build_name": func() string {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# and HCL2 calls (for example '${ var.string_value_example }' ). They won't be
|
||||
# executed together and the outcome will be unknown.
|
||||
|
||||
# See https://www.packer.io/docs/from-1.5/blocks/packer for more info
|
||||
# See https://www.packer.io//docs/templates/hcl_templates/blocks/packer for more info
|
||||
packer {
|
||||
required_version = ">= 1.6.0"
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ packer {
|
|||
# All generated input variables will be of 'string' type as this is how Packer JSON
|
||||
# views them; you can change their type later on. Read the variables type
|
||||
# constraints documentation
|
||||
# https://www.packer.io/docs/from-1.5/variables#type-constraints for more info.
|
||||
# https://www.packer.io//docs/templates/hcl_templates/variables#type-constraints for more info.
|
||||
variable "aws_access_key" {
|
||||
type = string
|
||||
default = ""
|
||||
|
@ -53,7 +53,7 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
|
|||
# source blocks are generated from your builders; a source can be referenced in
|
||||
# build blocks. A build block runs provisioner and post-processors on a
|
||||
# source. Read the documentation for source blocks here:
|
||||
# https://www.packer.io/docs/from-1.5/blocks/source
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/source
|
||||
source "amazon-ebs" "autogenerated_1" {
|
||||
access_key = "${var.aws_access_key}"
|
||||
ami_description = "Ubuntu 16.04 LTS - expand root partition"
|
||||
|
@ -92,7 +92,7 @@ source "amazon-ebs" "autogenerated_1" {
|
|||
|
||||
# a build block invokes sources and runs provisioning steps on them. The
|
||||
# documentation for build blocks can be found here:
|
||||
# https://www.packer.io/docs/from-1.5/blocks/build
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/build
|
||||
build {
|
||||
sources = ["source.amazon-ebs.autogenerated_1"]
|
||||
|
||||
|
@ -105,7 +105,7 @@ build {
|
|||
# template: hcl2_upgrade:2:38: executing "hcl2_upgrade" at <clean_resource_name>: error calling clean_resource_name: unhandled "clean_resource_name" call:
|
||||
# there is no way to automatically upgrade the "clean_resource_name" call.
|
||||
# Please manually upgrade to use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
|
||||
# Visit https://packer.io/docs/from-1.5/variables#custom-validation-rules , https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace for more infos.
|
||||
# Visit https://packer.io//docs/templates/hcl_templates/variables#custom-validation-rules , https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo mybuild-{{isotime | clean_resource_name}}"]
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ build {
|
|||
# template: hcl2_upgrade:2:35: executing "hcl2_upgrade" at <lower>: error calling lower: unhandled "lower" call:
|
||||
# there is no way to automatically upgrade the "lower" call.
|
||||
# Please manually upgrade to `lower(var.example)`
|
||||
# Visit https://www.packer.io/docs/from-1.5/functions/string/lower for more infos.
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/lower for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ `SOMETHING` | lower }}"]
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ build {
|
|||
# template: hcl2_upgrade:2:35: executing "hcl2_upgrade" at <upper>: error calling upper: unhandled "upper" call:
|
||||
# there is no way to automatically upgrade the "upper" call.
|
||||
# Please manually upgrade to `upper(var.example)`
|
||||
# Visit https://www.packer.io/docs/from-1.5/functions/string/upper for more infos.
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/upper for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ `something` | upper }}"]
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ build {
|
|||
# template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <split `some-string` `-` 0>: error calling split: unhandled "split" call:
|
||||
# there is no way to automatically upgrade the "split" call.
|
||||
# Please manually upgrade to `split(separator, string)`
|
||||
# Visit https://www.packer.io/docs/from-1.5/functions/string/split for more infos.
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/split for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ split `some-string` `-` 0 }}"]
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ build {
|
|||
# template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <replace_all `-` `/` build_name>: error calling replace_all: unhandled "replace_all" call:
|
||||
# there is no way to automatically upgrade the "replace_all" call.
|
||||
# Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
|
||||
# Visit https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace for more infos.
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ replace_all `-` `/` build_name }}"]
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ build {
|
|||
# template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <replace `some-string` `-` `/` 1>: error calling replace: unhandled "replace" call:
|
||||
# there is no way to automatically upgrade the "replace" call.
|
||||
# Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
|
||||
# Visit https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace for more infos.
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ replace `some-string` `-` `/` 1 }}"]
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ func (v *Variable) Value() (cty.Value, hcl.Diagnostics) {
|
|||
Severity: hcl.DiagError,
|
||||
Summary: fmt.Sprintf("Unset variable %q", v.Name),
|
||||
Detail: "A used variable must be set or have a default value; see " +
|
||||
"https://packer.io/docs/configuration/from-1.5/syntax for " +
|
||||
"https://packer.io/docs/templates/hcl_templates/syntax for " +
|
||||
"details.",
|
||||
Context: v.Range.Ptr(),
|
||||
}}
|
||||
|
|
|
@ -59,7 +59,7 @@ func decodeVersionConstraint(attr *hcl.Attribute) (VersionConstraint, hcl.Diagno
|
|||
diags = append(diags, &hcl.Diagnostic{
|
||||
Severity: hcl.DiagError,
|
||||
Summary: "Invalid version constraint",
|
||||
Detail: "This string does not use correct version constraint syntax. Check out the docs: https://packer.io/docs/from-1.5/blocks/packer#version-constraints",
|
||||
Detail: "This string does not use correct version constraint syntax. Check out the docs: https://packer.io//docs/templates/hcl_templates/blocks/packer#version-constraints",
|
||||
Subject: attr.Expr.Range().Ptr(),
|
||||
})
|
||||
return ret, diags
|
||||
|
|
|
@ -142,7 +142,7 @@ Here is a basic example. It is completely valid except for the access keys:
|
|||
// set the environment variables to have the same name as the declared
|
||||
// variables, with the prefix PKR_VAR_.
|
||||
|
||||
// There are other ways to [set variables](/docs/from-1.5/variables#assigning-values-to-build-variables), including from a var
|
||||
// There are other ways to [set variables](//docs/templates/hcl_templates/variables#assigning-values-to-build-variables), including from a var
|
||||
// file or as a command argument.
|
||||
|
||||
// export PKR_VAR_aws_access_key=$YOURKEY
|
||||
|
@ -514,7 +514,7 @@ variables are available:
|
|||
|
||||
## Build Shared Information Variables
|
||||
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
The generated variables available for this builder are:
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ run:
|
|||
// set the environment variables to have the same name as the declared
|
||||
// variables, with the prefix PKR_VAR_.
|
||||
|
||||
// There are other ways to [set variables](/docs/from-1.5/variables#assigning-values-to-build-variables)
|
||||
// There are other ways to [set variables](//docs/templates/hcl_templates/variables#assigning-values-to-build-variables)
|
||||
// including from a var file or as a command argument.
|
||||
|
||||
// export PKR_VAR_aws_access_key=$YOURKEY
|
||||
|
@ -323,7 +323,7 @@ variables are available:
|
|||
|
||||
## Build Shared Information Variables
|
||||
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
The generated variables available for this builder are:
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ variables are available:
|
|||
|
||||
## Build Shared Information Variables
|
||||
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
The generated variables available for this builder are:
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ variables are available:
|
|||
|
||||
## Build Shared Information Variables
|
||||
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
The generated variables available for this builder are:
|
||||
|
||||
|
@ -281,7 +281,7 @@ marked for deletion on termination will remain in your account.
|
|||
|
||||
## Build Shared Information Variables
|
||||
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
The generated variables available for this builder are:
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ variables are available:
|
|||
|
||||
## Build Shared Information Variables
|
||||
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
The generated variables available for this builder are:
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ You must specify (only) one of `commit`, `discard`, or `export_path`.
|
|||
## Build Shared Information Variables
|
||||
|
||||
This build shares generated data with provisioners and post-processors via [template engines](/docs/templates/engine)
|
||||
for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
The generated variable available for this builder is:
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ In configuration directives the following variables are available:
|
|||
## Build Shared Information Variables
|
||||
|
||||
This builder generates data that are shared with provisioner and post-processor via build function of
|
||||
[template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables)
|
||||
[template engine](/docs/templates/engine) for JSON and [contextual variables](//docs/templates/hcl_templates/contextual-variables)
|
||||
for HCL2.
|
||||
|
||||
The generated variables available for this builder see above
|
||||
|
|
|
@ -117,7 +117,7 @@ $ echo {{timestamp}} | packer console
|
|||
templating ( or `{{..}}` calls ) will not work in HCL2 mode.
|
||||
|
||||
Without a config file, `packer console` can be used to experiment with the
|
||||
expression syntax and [built-in functions](/docs/from-1.5/functions).
|
||||
expression syntax and [built-in functions](//docs/templates/hcl_templates/functions).
|
||||
|
||||
### Starting
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ here is the list of calls that should get transformed:
|
|||
- `` {{ user `my_var` }} `` becomes `${var.my_var}`.
|
||||
- `` {{ env `my_var` }} `` becomes `${var.my_var}`. Packer HCL2 supports
|
||||
environment variables through input variables. See
|
||||
[docs](http://packer.io/docs/from-1.5/variables#environment-variables)
|
||||
[docs](http://packer.io//docs/templates/hcl_templates/variables#environment-variables)
|
||||
for more info.
|
||||
- `{{ timestamp }}` becomes `${local.timestamp}`, the local variable
|
||||
will be created for all generated files.
|
||||
|
|
|
@ -205,7 +205,7 @@ provide to procisioners (see below for more details on generatedData.)
|
|||
Packer makes it possible to provide custom template engine variables to be
|
||||
shared with provisioners and post-processors using the `build` function.
|
||||
Json template `build` docs are [here](https://www.packer.io/docs/templates/engine#build)
|
||||
and HCL template build docs are [here](https://www.packer.io/docs/from-1.5/contextual-variables#build-variables).
|
||||
and HCL template build docs are [here](https://www.packer.io//docs/templates/hcl_templates/contextual-variables#build-variables).
|
||||
|
||||
As of Packer v1.5.0, builder Prepare() methods return a list of custom variables
|
||||
which we call `generated data`. We use that list of variables to generate a
|
||||
|
|
|
@ -102,7 +102,7 @@ more details about certain options in following sections.
|
|||
|
||||
- `vagrantfile_template` (string) - Path to a template to use for the
|
||||
Vagrantfile that is packaged with the box. This option supports the usage of the [template engine](/docs/templates/engine)
|
||||
for JSON and the [contextual variables](/docs/from-1.5/contextual-variables) for HCL2.
|
||||
for JSON and the [contextual variables](//docs/templates/hcl_templates/contextual-variables) for HCL2.
|
||||
|
||||
- `vagrantfile_template_generated` (boolean) - By default, Packer will
|
||||
exit with an error if the file specified using the
|
||||
|
|
|
@ -16,12 +16,12 @@ To use builders in a `build` block you can either:
|
|||
|
||||
- Set the `sources` array of string with references to pre-defined sources.
|
||||
|
||||
- Define [build-level `source` blocks](/docs/from-1.5/blocks/build/source).
|
||||
- Define [build-level `source` blocks](//docs/templates/hcl_templates/blocks/build/source).
|
||||
This also allows you to set specific fields.
|
||||
|
||||
`@include 'from-1.5/builds/example-block.mdx'`
|
||||
|
||||
Define [top-level `source` blocks](/docs/from-1.5/blocks/source) to configure
|
||||
Define [top-level `source` blocks](//docs/templates/hcl_templates/blocks/source) to configure
|
||||
your builders. The list of available builders can be found in the
|
||||
[builders](/docs/builders) section.
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ can be found in the [post-processors](/docs/post-processors) section.
|
|||
|
||||
A `post-processor` can also take the `Artifact` from another post-processor
|
||||
when it is defined in a [`post-processors`
|
||||
block](/docs/from-1.5/blocks/build/post-processor) list, that is a list of
|
||||
block](//docs/templates/hcl_templates/blocks/build/post-processor) list, that is a list of
|
||||
chained post processors.
|
||||
|
||||
-> Note: The input 'artifact' received by a post-processor will be automatically
|
||||
|
@ -84,11 +84,11 @@ The values within `only` or `except` are _source names_, not builder types.
|
|||
Packer allows to access connection information and basic instance state
|
||||
information from a post-processor. These information are stored in the `build`
|
||||
variable. Check out the [Contextual
|
||||
Variables](/docs/from-1.5/contextual-variables) documentation to learn more
|
||||
Variables](//docs/templates/hcl_templates/contextual-variables) documentation to learn more
|
||||
about and see some examples of how to use them.
|
||||
|
||||
### Related
|
||||
|
||||
- The [`post-processors` block](/docs/from-1.5/blocks/build/post-processor)
|
||||
- The [`post-processors` block](//docs/templates/hcl_templates/blocks/build/post-processor)
|
||||
allows to define one or more chain of `post-processor`s that will take the
|
||||
output from the build and provision steps.
|
||||
|
|
|
@ -11,7 +11,7 @@ sidebar_title: <tt>post-processors</tt>
|
|||
`@include 'from-1.5/beta-hcl2-note.mdx'`
|
||||
|
||||
The `post-processors` block allows to define lists of
|
||||
[`post-processor`s](/docs/from-1.5/blocks/build/post-processor), that will run
|
||||
[`post-processor`s](//docs/templates/hcl_templates/blocks/build/post-processor), that will run
|
||||
from the artifact of each build.
|
||||
|
||||
```hcl
|
||||
|
@ -34,7 +34,7 @@ build {
|
|||
}
|
||||
```
|
||||
|
||||
The [`post-processor` block](/docs/from-1.5/blocks/build/post-processor)
|
||||
The [`post-processor` block](//docs/templates/hcl_templates/blocks/build/post-processor)
|
||||
allows to define multiple post-processors that will run from the `Artifact` of
|
||||
each build. Read the `post-processor` documentation to know how to use a
|
||||
post-processor.
|
||||
|
|
|
@ -161,4 +161,4 @@ Timeout has no effect in debug mode.
|
|||
## Build Contextual Variables
|
||||
|
||||
Packer allows to access connection information and basic instance state information from a provisioner. These information are stored in the `build` variable.
|
||||
Check out the [Contextual Variables](/docs/from-1.5/contextual-variables) documentation to learn more about and see some examples of how to use them.
|
||||
Check out the [Contextual Variables](//docs/templates/hcl_templates/contextual-variables) documentation to learn more about and see some examples of how to use them.
|
||||
|
|
|
@ -44,16 +44,16 @@ list of all of the available built-in HCL2 blocks.
|
|||
|
||||
`@include 'from-1.5/variables/foo-block.mdx'`
|
||||
|
||||
- [Variable block documentation](/docs/from-1.5/blocks/variable).
|
||||
- [Variable block documentation](//docs/templates/hcl_templates/blocks/variable).
|
||||
|
||||
`@include 'from-1.5/locals/example-block.mdx'`
|
||||
|
||||
- [Locals block documentation](/docs/from-1.5/blocks/locals).
|
||||
- [Locals block documentation](//docs/templates/hcl_templates/blocks/locals).
|
||||
|
||||
`@include 'from-1.5/sources/example-block.mdx'`
|
||||
|
||||
- [source block documentation](/docs/from-1.5/blocks/source).
|
||||
- [source block documentation](//docs/templates/hcl_templates/blocks/source).
|
||||
|
||||
`@include 'from-1.5/builds/example-block.mdx'`
|
||||
|
||||
- [build block documentation](/docs/from-1.5/blocks/build).
|
||||
- [build block documentation](//docs/templates/hcl_templates/blocks/build).
|
||||
|
|
|
@ -17,6 +17,6 @@ your Packer configuration.
|
|||
|
||||
# More on variables
|
||||
|
||||
- Read the [full locals](/docs/from-1.5/locals) description for a more
|
||||
- Read the [full locals](//docs/templates/hcl_templates/locals) description for a more
|
||||
thorough read.
|
||||
- Read the [variables guide](/guides/hcl/variables) for more examples.
|
||||
|
|
|
@ -62,7 +62,7 @@ other dependency management systems like Bundler and NPM.
|
|||
required_version = ">= 1.2.0, < 2.0.0"
|
||||
```
|
||||
|
||||
A version constraint is a [string literal](/docs/from-1.5/expressions#string-literals)
|
||||
A version constraint is a [string literal](//docs/templates/hcl_templates/expressions#string-literals)
|
||||
containing one or more conditions, which are separated by commas.
|
||||
|
||||
Each condition consists of an operator and a version number.
|
||||
|
|
|
@ -14,7 +14,7 @@ The top-level `source` block defines reusable builder configuration blocks:
|
|||
`@include 'from-1.5/sources/example-block.mdx'`
|
||||
|
||||
You can start builders by refering to those source blocks form a [`build`
|
||||
block](/docs/from-1.5/blocks/build), for example :
|
||||
block](//docs/templates/hcl_templates/blocks/build), for example :
|
||||
|
||||
```hcl
|
||||
build {
|
||||
|
@ -26,7 +26,7 @@ build {
|
|||
}
|
||||
```
|
||||
|
||||
The build-level [`source` block](/docs/from-1.5/blocks/build/source) allows to
|
||||
The build-level [`source` block](//docs/templates/hcl_templates/blocks/build/source) allows to
|
||||
set specific source fields.
|
||||
|
||||
```hcl
|
||||
|
|
|
@ -12,7 +12,7 @@ sidebar_title: <tt>variable</tt>
|
|||
|
||||
The `variable` block, also called the `input-variable` block, defines variables
|
||||
within your Packer configuration. An input-variable cannot be used in another
|
||||
input variable: we recommend using [locals](/docs/from-1.5/blocks/locals) for that instead.
|
||||
input variable: we recommend using [locals](//docs/templates/hcl_templates/blocks/locals) for that instead.
|
||||
|
||||
`@include 'from-1.5/variables/foo-block.mdx'`
|
||||
|
||||
|
|
|
@ -67,8 +67,8 @@ Here is the list of available build variables:
|
|||
For backwards compatibility, `WinRMPassword` is also available through this
|
||||
engine, though it is no different than using the more general `Password`.
|
||||
|
||||
All build variables are valid to use with any of the [HCL2 functions](/docs/from-1.5/functions).
|
||||
Example of using [upper](/docs/from-1.5/functions/string/upper) to upper case the build ID:
|
||||
All build variables are valid to use with any of the [HCL2 functions](//docs/templates/hcl_templates/functions).
|
||||
Example of using [upper](//docs/templates/hcl_templates/functions/string/upper) to upper case the build ID:
|
||||
|
||||
```hcl
|
||||
post-processor "shell-local" {
|
||||
|
|
|
@ -124,7 +124,7 @@ types described above:
|
|||
|
||||
Key/value pairs can be separated by either a comma or a line break. Values
|
||||
can be arbitrary expressions. Keys are strings; they can be left unquoted if
|
||||
they are a valid [identifier](/docs/from-1.5/syntax#identifiers), but must be quoted
|
||||
they are a valid [identifier](//docs/templates/hcl_templates/syntax#identifiers), but must be quoted
|
||||
otherwise. You can use a non-literal expression as a key by wrapping it in
|
||||
parentheses, like `(var.business_unit_tag_name) = "SRE"`.
|
||||
|
||||
|
@ -135,13 +135,13 @@ Packer makes one named values available.
|
|||
The following named values are available:
|
||||
|
||||
- `source.<SOURCE TYPE>.<NAME>` is an object representing a
|
||||
[source](/docs/from-1.5/blocks/source) of the given type
|
||||
[source](//docs/templates/hcl_templates/blocks/source) of the given type
|
||||
and name.
|
||||
|
||||
### Available Functions
|
||||
|
||||
For a full list of available functions, see [the function
|
||||
reference](/docs/configuration/from-1.5/functions).
|
||||
reference](/docs/templates/hcl_templates/functions).
|
||||
|
||||
## `for` Expressions
|
||||
|
||||
|
@ -336,8 +336,8 @@ block. If you need to declare resource instances based on a nested data
|
|||
structure or combinations of elements from multiple data structures you can use
|
||||
expressions and functions to derive a suitable value. For some common examples
|
||||
of such situations, see the
|
||||
[`flatten`](/docs/configuration/from-1.5/functions/collection/flatten) and
|
||||
[`setproduct`](/docs/configuration/from-1.5/functions/collection/setproduct)
|
||||
[`flatten`](/docs/templates/hcl_templates/functions/collection/flatten) and
|
||||
[`setproduct`](/docs/templates/hcl_templates/functions/collection/setproduct)
|
||||
functions.
|
||||
|
||||
### Best Practices for `dynamic` Blocks
|
||||
|
|
|
@ -32,5 +32,5 @@ b
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`coalescelist`](/docs/from-1.5/functions/collection/coalescelist) performs a similar operation with
|
||||
- [`coalescelist`](//docs/templates/hcl_templates/functions/collection/coalescelist) performs a similar operation with
|
||||
list arguments rather than individual arguments.
|
||||
|
|
|
@ -39,5 +39,5 @@ symbol to expand the outer list as arguments:
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`coalesce`](/docs/from-1.5/functions/collection/coalesce) performs a similar operation with string
|
||||
- [`coalesce`](//docs/templates/hcl_templates/functions/collection/coalesce) performs a similar operation with string
|
||||
arguments rather than list arguments.
|
||||
|
|
|
@ -35,5 +35,5 @@ a
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`index`](/docs/from-1.5/functions/collection/index-fn) finds the index for a particular element value.
|
||||
- [`lookup`](/docs/from-1.5/functions/collection/lookup) retrieves a value from a _map_ given its _key_.
|
||||
- [`index`](//docs/templates/hcl_templates/functions/collection/index-fn) finds the index for a particular element value.
|
||||
- [`lookup`](//docs/templates/hcl_templates/functions/collection/lookup) retrieves a value from a _map_ given its _key_.
|
||||
|
|
|
@ -31,7 +31,7 @@ Indirectly-nested lists, such as those in maps, are _not_ flattened.
|
|||
The
|
||||
[resource `for_each`](https://www.terraform.io/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings)
|
||||
and
|
||||
[`dynamic` block](/docs/from-1.5/expressions#dynamic-blocks)
|
||||
[`dynamic` block](//docs/templates/hcl_templates/expressions#dynamic-blocks)
|
||||
language features both require a collection value that has one element for
|
||||
each repetition.
|
||||
|
||||
|
@ -104,6 +104,6 @@ the associations between the subnets and their containing networks.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`setproduct`](/docs/from-1.5/functions/collection/setproduct) finds all of the combinations of multiple
|
||||
- [`setproduct`](//docs/templates/hcl_templates/functions/collection/setproduct) finds all of the combinations of multiple
|
||||
lists or sets of values, which can also be useful when preparing collections
|
||||
for use with `for_each` constructs.
|
||||
|
|
|
@ -24,5 +24,5 @@ value is not present in the list.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`element`](/docs/from-1.5/functions/collection/element) retrieves a particular element from a list given
|
||||
- [`element`](//docs/templates/hcl_templates/functions/collection/element) retrieves a particular element from a list given
|
||||
its index.
|
||||
|
|
|
@ -24,4 +24,4 @@ be identical as long as the keys in the map don't change.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`values`](/docs/from-1.5/functions/collection/values) returns a list of the _values_ from a map.
|
||||
- [`values`](//docs/templates/hcl_templates/functions/collection/values) returns a list of the _values_ from a map.
|
||||
|
|
|
@ -28,4 +28,4 @@ what?
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`element`](/docs/from-1.5/functions/collection/element) retrieves a value from a _list_ given its _index_.
|
||||
- [`element`](//docs/templates/hcl_templates/functions/collection/element) retrieves a value from a _list_ given its _index_.
|
||||
|
|
|
@ -22,4 +22,4 @@ with all of the same elements as the given sequence but in reverse order.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`strrev`](/docs/from-1.5/functions/string/strrev) reverses a string.
|
||||
- [`strrev`](//docs/templates/hcl_templates/functions/string/strrev) reverses a string.
|
||||
|
|
|
@ -31,9 +31,9 @@ the ordering of the given elements is not preserved.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`contains`](/docs/from-1.5/functions/collection/contains) tests whether a given list or set contains
|
||||
- [`contains`](//docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains
|
||||
a given element value.
|
||||
- [`setproduct`](/docs/from-1.5/functions/collection/setproduct) computes the _Cartesian product_ of multiple
|
||||
- [`setproduct`](//docs/templates/hcl_templates/functions/collection/setproduct) computes the _Cartesian product_ of multiple
|
||||
sets.
|
||||
- [`setunion`](/docs/from-1.5/functions/collection/setunion) computes the _union_ of
|
||||
- [`setunion`](//docs/templates/hcl_templates/functions/collection/setunion) computes the _union_ of
|
||||
multiple sets.
|
||||
|
|
|
@ -118,7 +118,7 @@ elements all have a consistent type:
|
|||
The
|
||||
[resource `for_each`](https://www.terraform.io/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings)
|
||||
and
|
||||
[`dynamic` block](/docs/from-1.5/expressions/#dynamic-blocks)
|
||||
[`dynamic` block](//docs/templates/hcl_templates/expressions/#dynamic-blocks)
|
||||
language features both require a collection value that has one element for
|
||||
each repetition.
|
||||
|
||||
|
@ -212,12 +212,12 @@ elements in the input variables.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`contains`](/docs/from-1.5/functions/collection/contains) tests whether a given list or set contains
|
||||
- [`contains`](//docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains
|
||||
a given element value.
|
||||
- [`flatten`](/docs/from-1.5/functions/collection/flatten) is useful for flattening heirarchical data
|
||||
- [`flatten`](//docs/templates/hcl_templates/functions/collection/flatten) is useful for flattening heirarchical data
|
||||
into a single list, for situations where the relationships between two
|
||||
object types are defined explicitly.
|
||||
- [`setintersection`](/docs/from-1.5/functions/collection/setintersection) computes the _intersection_ of
|
||||
- [`setintersection`](//docs/templates/hcl_templates/functions/collection/setintersection) computes the _intersection_ of
|
||||
multiple sets.
|
||||
- [`setunion`](/docs/from-1.5/functions/collection/setunion) computes the _union_ of multiple
|
||||
- [`setunion`](//docs/templates/hcl_templates/functions/collection/setunion) computes the _union_ of multiple
|
||||
sets.
|
||||
|
|
|
@ -34,9 +34,9 @@ the ordering of the given elements is not preserved.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`contains`](/docs/from-1.5/functions/collection/contains) tests whether a given list or set contains
|
||||
- [`contains`](//docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains
|
||||
a given element value.
|
||||
- [`setintersection`](/docs/from-1.5/functions/collection/setintersection) computes the _intersection_ of
|
||||
- [`setintersection`](//docs/templates/hcl_templates/functions/collection/setintersection) computes the _intersection_ of
|
||||
multiple sets.
|
||||
- [`setproduct`](/docs/from-1.5/functions/collection/setproduct) computes the _Cartesian product_ of multiple
|
||||
- [`setproduct`](//docs/templates/hcl_templates/functions/collection/setproduct) computes the _Cartesian product_ of multiple
|
||||
sets.
|
||||
|
|
|
@ -28,5 +28,5 @@ list.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`substr`](/docs/from-1.5/functions/string/substr) performs a similar function for characters in a
|
||||
- [`substr`](//docs/templates/hcl_templates/functions/string/substr) performs a similar function for characters in a
|
||||
string, although it uses a length instead of an end index.
|
||||
|
|
|
@ -11,7 +11,7 @@ in that map.
|
|||
|
||||
The values are returned in lexicographical order by their corresponding _keys_,
|
||||
so the values will be returned in the same order as their keys would be
|
||||
returned from [`keys`](/docs/from-1.5/functions/collection/keys).
|
||||
returned from [`keys`](//docs/templates/hcl_templates/functions/collection/keys).
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -26,4 +26,4 @@ returned from [`keys`](/docs/from-1.5/functions/collection/keys).
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`keys`](/docs/from-1.5/functions/collection/keys) returns a list of the _keys_ from a map.
|
||||
- [`keys`](//docs/templates/hcl_templates/functions/collection/keys) returns a list of the _keys_ from a map.
|
||||
|
|
|
@ -19,7 +19,7 @@ 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](/docs/from-1.5/variables#variable-definition-precedence).
|
||||
precedence](//docs/templates/hcl_templates/variables#variable-definition-precedence).
|
||||
|
||||
-> **Why can't I use environment variables elsewhere?** User variables are the
|
||||
single source of configurable input. We felt that having environment variables
|
||||
|
@ -31,7 +31,7 @@ template that a user can easily discover using `packer inspect`.
|
|||
When the environment variable is not set at all -- not even with the empty
|
||||
string -- the value returned by `env` will be an an empty string. It will still
|
||||
be possible to set it using other means but you could use [custom validation
|
||||
rules](/docs/from-1.5/variables#custom-validation-rules) to error in that case
|
||||
rules](//docs/templates/hcl_templates/variables#custom-validation-rules) to error in that case
|
||||
to make sure it is set, for example:
|
||||
|
||||
```hcl
|
||||
|
|
|
@ -13,7 +13,7 @@ whether the expression produced a result without any errors.
|
|||
|
||||
This is a special function that is able to catch errors produced when evaluating
|
||||
its argument. For most situations where you could use `can` it's better to use
|
||||
[`try`](/docs/from-1.5/functions/conversion/try) instead, because it allows for more concise definition of
|
||||
[`try`](//docs/templates/hcl_templates/functions/conversion/try) instead, because it allows for more concise definition of
|
||||
fallback values for failing expressions.
|
||||
|
||||
The `can` function can only catch and handle _dynamic_ errors resulting from
|
||||
|
@ -25,7 +25,7 @@ as a malformed resource reference.
|
|||
variable validation rules. Although it can technically accept any sort of
|
||||
expression and be used elsewhere in the configuration, we recommend against
|
||||
using it in other contexts. For error handling elsewhere in the configuration,
|
||||
prefer to use [`try`](/docs/from-1.5/functions/conversion/try).
|
||||
prefer to use [`try`](//docs/templates/hcl_templates/functions/conversion/try).
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -54,5 +54,5 @@ A local value with the name "nonexist" has not been declared.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`try`](/docs/from-1.5/functions/conversion/try), which tries evaluating a sequence of expressions and
|
||||
- [`try`](//docs/templates/hcl_templates/functions/conversion/try), which tries evaluating a sequence of expressions and
|
||||
returns the result of the first one that succeeds.
|
||||
|
|
|
@ -108,5 +108,5 @@ A local value with the name "nonexist" has not been declared.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`can`](/docs/from-1.5/functions/conversion/can), which tries evaluating an expression and returns a
|
||||
- [`can`](//docs/templates/hcl_templates/functions/conversion/can), which tries evaluating an expression and returns a
|
||||
boolean value indicating whether it succeeded.
|
||||
|
|
|
@ -100,7 +100,7 @@ configuration as needed:
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`format`](/docs/from-1.5/functions/string/format) is a more general formatting function for arbitrary
|
||||
- [`format`](//docs/templates/hcl_templates/functions/string/format) is a more general formatting function for arbitrary
|
||||
data.
|
||||
- [`timestamp`](/docs/from-1.5/functions/datetime/timestamp) returns the current date and time in a format
|
||||
- [`timestamp`](//docs/templates/hcl_templates/functions/datetime/timestamp) returns the current date and time in a format
|
||||
suitable for input to `formatdate`.
|
||||
|
|
|
@ -30,7 +30,7 @@ of adding the given direction to the given timestamp.
|
|||
-> **Breaking change note:** Packer previously let you decide your own "Date
|
||||
and Time format" syntax. With HCL2 and for parity with Terraform, Packer will
|
||||
be using the [RFC 3339](https://tools.ietf.org/html/rfc3339) "Date and Time
|
||||
format" syntax. As a string. [`formatdate`](/docs/from-1.5/functions/datetime/formatdate) still allows you
|
||||
format" syntax. As a string. [`formatdate`](//docs/templates/hcl_templates/functions/datetime/formatdate) still allows you
|
||||
to format a date.
|
||||
|
||||
## Examples
|
||||
|
|
|
@ -22,7 +22,7 @@ Packer run.
|
|||
-> **Breaking change note:** Packer previously let you decide your own "Date
|
||||
and Time format" syntax. With HCL2 and for parity with Terraform, Packer will
|
||||
be using the [RFC 3339](https://tools.ietf.org/html/rfc3339) "Date and Time
|
||||
format" syntax. As a string. [`formatdate`](/docs/from-1.5/functions/datetime/formatdate) still allows you
|
||||
format" syntax. As a string. [`formatdate`](//docs/templates/hcl_templates/functions/datetime/formatdate) still allows you
|
||||
to format a date.
|
||||
|
||||
## Examples
|
||||
|
@ -34,5 +34,5 @@ to format a date.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`formatdate`](/docs/from-1.5/functions/datetime/formatdate) can convert the resulting timestamp to
|
||||
- [`formatdate`](//docs/templates/hcl_templates/functions/datetime/formatdate) can convert the resulting timestamp to
|
||||
other date and time formats.
|
||||
|
|
|
@ -33,5 +33,5 @@ Hello World
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`base64encode`](/docs/from-1.5/functions/encoding/base64encode) performs the opposite operation,
|
||||
- [`base64encode`](//docs/templates/hcl_templates/functions/encoding/base64encode) performs the opposite operation,
|
||||
encoding the UTF-8 bytes for a string as Base64.
|
||||
|
|
|
@ -34,5 +34,5 @@ SGVsbG8gV29ybGQ=
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`base64decode`](/docs/from-1.5/functions/encoding/base64decode) performs the opposite operation,
|
||||
- [`base64decode`](//docs/templates/hcl_templates/functions/encoding/base64decode) performs the opposite operation,
|
||||
decoding Base64 data and interpreting it as a UTF-8 string.
|
||||
|
|
|
@ -14,7 +14,7 @@ of the result of decoding that string.
|
|||
The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159).
|
||||
|
||||
This function maps JSON values to
|
||||
[Packer language values](/docs/from-1.5/expressions#types-and-values)
|
||||
[Packer language values](//docs/templates/hcl_templates/expressions#types-and-values)
|
||||
in the following way:
|
||||
|
||||
| JSON type | Packer type |
|
||||
|
@ -43,5 +43,5 @@ true
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`jsonencode`](/docs/from-1.5/functions/encoding/jsonencode) performs the opposite operation, _encoding_
|
||||
- [`jsonencode`](//docs/templates/hcl_templates/functions/encoding/jsonencode) performs the opposite operation, _encoding_
|
||||
a value as JSON.
|
||||
|
|
|
@ -11,7 +11,7 @@ description: The jsonencode function encodes a given value as a JSON string.
|
|||
The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159).
|
||||
|
||||
This function maps
|
||||
[Packer language values](/docs/from-1.5/expressions#types-and-values)
|
||||
[Packer language values](//docs/templates/hcl_templates/expressions#types-and-values)
|
||||
to JSON values in the following way:
|
||||
|
||||
| Packer type | JSON type |
|
||||
|
@ -40,5 +40,5 @@ rarely a problem in practice.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`jsondecode`](/docs/from-1.5/functions/encoding/jsondecode) performs the opposite operation, _decoding_
|
||||
- [`jsondecode`](//docs/templates/hcl_templates/functions/encoding/jsondecode) performs the opposite operation, _decoding_
|
||||
a JSON string to obtain its represented value.
|
||||
|
|
|
@ -15,7 +15,7 @@ This function supports a subset of [YAML 1.2](https://yaml.org/spec/1.2/spec.htm
|
|||
as described below.
|
||||
|
||||
This function maps YAML values to
|
||||
[Packer language values](/docs/from-1.5/expressions#types-and-values)
|
||||
[Packer language values](//docs/templates/hcl_templates/expressions#types-and-values)
|
||||
in the following way:
|
||||
|
||||
| YAML type | Packer type |
|
||||
|
@ -94,7 +94,7 @@ Call to function "yamldecode" failed: unsupported tag "!not-supported".
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`jsondecode`](/docs/from-1.5/functions/encoding/jsondecode) is a similar operation using JSON instead
|
||||
- [`jsondecode`](//docs/templates/hcl_templates/functions/encoding/jsondecode) is a similar operation using JSON instead
|
||||
of YAML.
|
||||
- [`yamlencode`](/docs/from-1.5/functions/encoding/yamlencode) performs the opposite operation, _encoding_
|
||||
- [`yamlencode`](//docs/templates/hcl_templates/functions/encoding/yamlencode) performs the opposite operation, _encoding_
|
||||
a value as YAML.
|
||||
|
|
|
@ -13,7 +13,7 @@ description: The yamlencode function encodes a given value as a YAML string.
|
|||
result format may change in future versions of Packer, based on feedback.
|
||||
Do not use `yamldecode` to construct a value for any resource argument where
|
||||
changes to the result would be disruptive. To get a consistent string
|
||||
representation of a value use [`jsonencode`](/docs/from-1.5/functions/encoding/jsonencode) instead; its
|
||||
representation of a value use [`jsonencode`](//docs/templates/hcl_templates/functions/encoding/jsonencode) instead; its
|
||||
results are also valid YAML because YAML is a JSON superset.
|
||||
|
||||
<!--
|
||||
|
@ -27,7 +27,7 @@ results are also valid YAML because YAML is a JSON superset.
|
|||
-->
|
||||
|
||||
This function maps
|
||||
[Packer language values](/docs/from-1.5/expressions#types-and-values)
|
||||
[Packer language values](//docs/templates/hcl_templates/expressions#types-and-values)
|
||||
to YAML tags in the following way:
|
||||
|
||||
| Packer type | YAML type |
|
||||
|
@ -75,12 +75,12 @@ mean that this is rarely a problem in practice.
|
|||
|
||||
`yamlencode` always uses YAML's "block style" for mappings and sequences, unless
|
||||
the mapping or sequence is empty. To generate flow-style YAML, use
|
||||
[`jsonencode`](/docs/from-1.5/functions/encoding/jsonencode) instead: YAML flow-style is a superset
|
||||
[`jsonencode`](//docs/templates/hcl_templates/functions/encoding/jsonencode) instead: YAML flow-style is a superset
|
||||
of JSON syntax.
|
||||
|
||||
## Related Functions
|
||||
|
||||
- [`jsonencode`](/docs/from-1.5/functions/encoding/jsonencode) is a similar operation using JSON instead
|
||||
- [`jsonencode`](//docs/templates/hcl_templates/functions/encoding/jsonencode) is a similar operation using JSON instead
|
||||
of YAML.
|
||||
- [`yamldecode`](/docs/from-1.5/functions/encoding/yamldecode) performs the opposite operation, _decoding_
|
||||
- [`yamldecode`](//docs/templates/hcl_templates/functions/encoding/yamldecode) performs the opposite operation, _decoding_
|
||||
a YAML string to obtain its represented value.
|
||||
|
|
|
@ -14,7 +14,7 @@ Referring directly to filesystem paths in resource arguments may cause spurious
|
|||
diffs if the same configuration is applied from multiple systems or on
|
||||
different host operating systems. We recommend using filesystem paths only for
|
||||
transient values, such as the argument to
|
||||
[`file`](/docs/from-1.5/functions/file) (where only the contents are then
|
||||
[`file`](//docs/templates/hcl_templates/functions/file) (where only the contents are then
|
||||
stored).
|
||||
|
||||
## Examples
|
||||
|
|
|
@ -25,7 +25,7 @@ it uses backslash `\` as the path segment separator. On Unix systems, the slash
|
|||
Referring directly to filesystem paths in resource arguments may cause
|
||||
spurious diffs if the same configuration is applied from multiple systems or on
|
||||
different host operating systems. We recommend using filesystem paths only
|
||||
for transient values, such as the argument to [`file`](/docs/from-1.5/functions/file) (where
|
||||
for transient values, such as the argument to [`file`](//docs/templates/hcl_templates/functions/file) (where
|
||||
only the contents are then stored) or in `connection` and `provisioner` blocks.
|
||||
|
||||
## Examples
|
||||
|
@ -37,6 +37,6 @@ baz.txt
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`dirname`](/docs/from-1.5/functions/file/dirname) returns all of the segments of a filesystem path
|
||||
- [`dirname`](//docs/templates/hcl_templates/functions/file/dirname) returns all of the segments of a filesystem path
|
||||
_except_ the last, discarding the portion that would be returned by
|
||||
`basename`.
|
||||
|
|
|
@ -24,7 +24,7 @@ any slashes in the given path will be replaced by backslashes before returning.
|
|||
Referring directly to filesystem paths in resource arguments may cause
|
||||
spurious diffs if the same configuration is applied from multiple systems or on
|
||||
different host operating systems. We recommend using filesystem paths only
|
||||
for transient values, such as the argument to [`file`](/docs/from-1.5/functions/file) (where
|
||||
for transient values, such as the argument to [`file`](//docs/templates/hcl_templates/functions/file) (where
|
||||
only the contents are then stored) or in `connection` and `provisioner` blocks.
|
||||
|
||||
## Examples
|
||||
|
@ -36,5 +36,5 @@ foo/bar
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`basename`](/docs/from-1.5/functions/file/basename) returns _only_ the last portion of a filesystem
|
||||
- [`basename`](//docs/templates/hcl_templates/functions/file/basename) returns _only_ the last portion of a filesystem
|
||||
path, discarding the portion that would be returned by `dirname`.
|
||||
|
|
|
@ -38,5 +38,5 @@ Hello World
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`fileexists`](/docs/from-1.5/functions/file/fileexists) determines whether a file exists
|
||||
- [`fileexists`](//docs/templates/hcl_templates/functions/file/fileexists) determines whether a file exists
|
||||
at a given path.
|
||||
|
|
|
@ -32,4 +32,4 @@ fileexists("custom-section.sh") ? file("custom-section.sh") : local.default_cont
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`file`](/docs/from-1.5/functions/file) reads the contents of a file at a given path
|
||||
- [`file`](//docs/templates/hcl_templates/functions/file) reads the contents of a file at a given path
|
||||
|
|
|
@ -20,7 +20,7 @@ max(5, 12, 9)
|
|||
```
|
||||
|
||||
For more details on syntax, see
|
||||
[_Function Calls_](/docs/from-1.5/expressions#function-calls)
|
||||
[_Function Calls_](//docs/templates/hcl_templates/expressions#function-calls)
|
||||
on the Expressions page.
|
||||
|
||||
The HCL language does not support user-defined functions, and so only
|
||||
|
|
|
@ -22,7 +22,7 @@ cidrhost(prefix, hostnum)
|
|||
no more than the number of digits remaining in the address after the given
|
||||
prefix. For more details on how this function interprets CIDR prefixes and
|
||||
populates host numbers, see the worked example for
|
||||
[`cidrsubnet`](/docs/from-1.5/functions/ipnet/cidrsubnet).
|
||||
[`cidrsubnet`](//docs/templates/hcl_templates/functions/ipnet/cidrsubnet).
|
||||
|
||||
Conventionally host number zero is used to represent the address of the
|
||||
network itself and the host number that would fill all the host bits with
|
||||
|
@ -46,5 +46,5 @@ fd00:fd12:3456:7890::22
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`cidrsubnet`](/docs/from-1.5/functions/ipnet/cidrsubnet) calculates a subnet address under a given
|
||||
- [`cidrsubnet`](//docs/templates/hcl_templates/functions/ipnet/cidrsubnet) calculates a subnet address under a given
|
||||
network address prefix.
|
||||
|
|
|
@ -28,7 +28,7 @@ additional bits added to the prefix.
|
|||
This function accepts both IPv6 and IPv4 prefixes, and the result always uses
|
||||
the same addressing scheme as the given prefix.
|
||||
|
||||
Unlike the related function [`cidrsubnets`](/docs/from-1.5/functions/ipnet/cidrsubnets), `cidrsubnet`
|
||||
Unlike the related function [`cidrsubnets`](//docs/templates/hcl_templates/functions/ipnet/cidrsubnets), `cidrsubnet`
|
||||
allows you to give a specific network number to use. `cidrsubnets` can allocate
|
||||
multiple network addresses at once, but numbers them automatically starting
|
||||
with zero.
|
||||
|
@ -89,7 +89,7 @@ This gives us some additional information but also confirms (using a slightly
|
|||
different notation) the conversion from decimal to binary and shows the range
|
||||
of possible host addresses in this network.
|
||||
|
||||
While [`cidrhost`](/docs/from-1.5/functions/ipnet/cidrhost) allows calculating single host IP addresses,
|
||||
While [`cidrhost`](//docs/templates/hcl_templates/functions/ipnet/cidrhost) allows calculating single host IP addresses,
|
||||
`cidrsubnet` on the other hand creates a new network prefix _within_ the given
|
||||
network prefix. In other words, it creates a subnet.
|
||||
|
||||
|
@ -144,7 +144,7 @@ Hosts/Net: 14 Class A, Private Internet
|
|||
The new subnet has four bits available for host numbering, which means
|
||||
that there are 14 host addresses available for assignment once we subtract
|
||||
the network's own address and the broadcast address. You can thus use
|
||||
[`cidrhost`](/docs/from-1.5/functions/ipnet/cidrhost) function to calculate those host addresses by
|
||||
[`cidrhost`](//docs/templates/hcl_templates/functions/ipnet/cidrhost) function to calculate those host addresses by
|
||||
providing it a value between 1 and 14:
|
||||
|
||||
```shell-session
|
||||
|
@ -159,9 +159,9 @@ For more information on CIDR notation and subnetting, see
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`cidrhost`](/docs/from-1.5/functions/ipnet/cidrhost) calculates the IP address for a single host
|
||||
- [`cidrhost`](//docs/templates/hcl_templates/functions/ipnet/cidrhost) calculates the IP address for a single host
|
||||
within a given network address prefix.
|
||||
- [`cidrnetmask`](/docs/from-1.5/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR
|
||||
- [`cidrnetmask`](//docs/templates/hcl_templates/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR
|
||||
notation into netmask notation.
|
||||
- [`cidrsubnets`](/docs/from-1.5/functions/ipnet/cidrsubnets) can allocate multiple consecutive
|
||||
- [`cidrsubnets`](//docs/templates/hcl_templates/functions/ipnet/cidrsubnets) can allocate multiple consecutive
|
||||
addresses under a prefix at once, numbering them automatically.
|
||||
|
|
|
@ -23,7 +23,7 @@ value is therefore a list with one element per `newbits` argument, each
|
|||
a string containing an address range in CIDR notation.
|
||||
|
||||
For more information on IP addressing concepts, see the documentation for the
|
||||
related function [`cidrsubnet`](/docs/from-1.5/functions/ipnet/cidrsubnet). `cidrsubnet` calculates
|
||||
related function [`cidrsubnet`](//docs/templates/hcl_templates/functions/ipnet/cidrsubnet). `cidrsubnet` calculates
|
||||
a single subnet address within a prefix while allowing you to specify its
|
||||
subnet number, while `cidrsubnets` can calculate many at once, potentially of
|
||||
different sizes, and assigns subnet numbers automatically.
|
||||
|
@ -58,7 +58,7 @@ the same addressing scheme as the given prefix.
|
|||
```
|
||||
|
||||
You can use nested `cidrsubnets` calls with
|
||||
[`for` expressions](/docs/from-1.5/expressions#for-expressions)
|
||||
[`for` expressions](//docs/templates/hcl_templates/expressions#for-expressions)
|
||||
to concisely allocate groups of network address blocks:
|
||||
|
||||
```shell-session
|
||||
|
@ -85,9 +85,9 @@ to concisely allocate groups of network address blocks:
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`cidrhost`](/docs/from-1.5/functions/ipnet/cidrhost) calculates the IP address for a single host
|
||||
- [`cidrhost`](//docs/templates/hcl_templates/functions/ipnet/cidrhost) calculates the IP address for a single host
|
||||
within a given network address prefix.
|
||||
- [`cidrnetmask`](/docs/from-1.5/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR
|
||||
- [`cidrnetmask`](//docs/templates/hcl_templates/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR
|
||||
notation into netmask notation.
|
||||
- [`cidrsubnet`](/docs/from-1.5/functions/ipnet/cidrsubnet) calculates a single subnet address, allowing
|
||||
- [`cidrsubnet`](//docs/templates/hcl_templates/functions/ipnet/cidrsubnet) calculates a single subnet address, allowing
|
||||
you to specify its network number.
|
||||
|
|
|
@ -22,5 +22,5 @@ given value, which may be a fraction.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`floor`](/docs/from-1.5/functions/numeric/floor), which rounds to the nearest whole number _less than_
|
||||
- [`floor`](//docs/templates/hcl_templates/functions/numeric/floor), which rounds to the nearest whole number _less than_
|
||||
or equal.
|
||||
|
|
|
@ -22,5 +22,5 @@ given value, which may be a fraction.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`ceil`](/docs/from-1.5/functions/numeric/ceil), which rounds to the nearest whole number _greater than_
|
||||
- [`ceil`](//docs/templates/hcl_templates/functions/numeric/ceil), which rounds to the nearest whole number _greater than_
|
||||
or equal.
|
||||
|
|
|
@ -25,4 +25,4 @@ to individual arguments:
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`min`](/docs/from-1.5/functions/numeric/min), which returns the _smallest_ number from a set.
|
||||
- [`min`](//docs/templates/hcl_templates/functions/numeric/min), which returns the _smallest_ number from a set.
|
||||
|
|
|
@ -25,4 +25,4 @@ to individual arguments:
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`max`](/docs/from-1.5/functions/numeric/max), which returns the _greatest_ number from a set.
|
||||
- [`max`](//docs/templates/hcl_templates/functions/numeric/max), which returns the _greatest_ number from a set.
|
||||
|
|
|
@ -47,5 +47,5 @@ Invalid value for "number" parameter: cannot parse "12" as a base 2 integer.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`format`](/docs/from-1.5/functions/string/format) can format numbers and other values into strings,
|
||||
- [`format`](//docs/templates/hcl_templates/functions/string/format) can format numbers and other values into strings,
|
||||
with optional zero padding, alignment, etc.
|
||||
|
|
|
@ -24,5 +24,5 @@ hello
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`trimspace`](/docs/from-1.5/functions/string/trimspace), which removes all types of whitespace from
|
||||
- [`trimspace`](//docs/templates/hcl_templates/functions/string/trimspace), which removes all types of whitespace from
|
||||
both the start and the end of a string.
|
||||
|
|
|
@ -114,7 +114,7 @@ for an unsupported format verb.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`formatdate`](/docs/from-1.5/functions/datetime/formatdate) is a specialized formatting function for
|
||||
- [`formatdate`](//docs/templates/hcl_templates/functions/datetime/formatdate) is a specialized formatting function for
|
||||
human-readable timestamps.
|
||||
- [`formatlist`](/docs/from-1.5/functions/string/formatlist) uses the same specification syntax to
|
||||
- [`formatlist`](//docs/templates/hcl_templates/functions/string/formatlist) uses the same specification syntax to
|
||||
produce a list of strings.
|
||||
|
|
|
@ -16,7 +16,7 @@ formatlist(spec, values...)
|
|||
```
|
||||
|
||||
The specification string uses
|
||||
[the same syntax as `format`](/docs/from-1.5/functions/string/format#specification-syntax).
|
||||
[the same syntax as `format`](//docs/templates/hcl_templates/functions/string/format#specification-syntax).
|
||||
|
||||
The given values can be a mixture of list and non-list arguments. Any given
|
||||
lists must be the same length, which decides the length of the resulting list.
|
||||
|
@ -46,5 +46,5 @@ once per element of the list arguments.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`format`](/docs/from-1.5/functions/string/format) defines the specification syntax used by this
|
||||
- [`format`](//docs/templates/hcl_templates/functions/string/format) defines the specification syntax used by this
|
||||
function and produces a single string as its result.
|
||||
|
|
|
@ -26,5 +26,5 @@ foo
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`split`](/docs/from-1.5/functions/string/split) performs the opposite operation: producing a list
|
||||
- [`split`](//docs/templates/hcl_templates/functions/string/split) performs the opposite operation: producing a list
|
||||
by separating a single string using a given delimiter.
|
||||
|
|
|
@ -23,5 +23,5 @@ This function uses Unicode's definition of letters and of upper- and lowercase.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`upper`](/docs/from-1.5/functions/string/upper) converts letters in a string to _uppercase_.
|
||||
- [`title`](/docs/from-1.5/functions/string/title) converts the first letter of each word in a string to uppercase.
|
||||
- [`upper`](//docs/templates/hcl_templates/functions/string/upper) converts letters in a string to _uppercase_.
|
||||
- [`title`](//docs/templates/hcl_templates/functions/string/title) converts the first letter of each word in a string to uppercase.
|
||||
|
|
|
@ -44,5 +44,5 @@ hello everybody
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`replace`](/docs/from-1.5/functions/string/replace) searches a given string for another given
|
||||
- [`replace`](//docs/templates/hcl_templates/functions/string/replace) searches a given string for another given
|
||||
substring, and replaces all occurrences with a given replacement string.
|
||||
|
|
|
@ -27,5 +27,5 @@ hello everybody
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`regex_replace`](/docs/from-1.5/functions/string/regex_replace) searches a given string for another given substring,
|
||||
- [`regex_replace`](//docs/templates/hcl_templates/functions/string/regex_replace) searches a given string for another given substring,
|
||||
and replaces each occurrence with a given replacement string.
|
||||
|
|
|
@ -36,5 +36,5 @@ split(separator, string)
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`join`](/docs/from-1.5/functions/string/join) performs the opposite operation: producing a string
|
||||
- [`join`](//docs/templates/hcl_templates/functions/string/join) performs the opposite operation: producing a string
|
||||
joining together a list of strings with a given separator.
|
||||
|
|
|
@ -24,4 +24,4 @@ olleh
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`reverse`](/docs/from-1.5/functions/collection/reverse) reverses a sequence.
|
||||
- [`reverse`](//docs/templates/hcl_templates/functions/collection/reverse) reverses a sequence.
|
||||
|
|
|
@ -21,5 +21,5 @@ This function uses Unicode's definition of letters and of upper- and lowercase.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`upper`](/docs/from-1.5/functions/string/upper) converts _all_ letters in a string to uppercase.
|
||||
- [`lower`](/docs/from-1.5/functions/string/lower) converts all letters in a string to lowercase.
|
||||
- [`upper`](//docs/templates/hcl_templates/functions/string/upper) converts _all_ letters in a string to uppercase.
|
||||
- [`lower`](//docs/templates/hcl_templates/functions/string/lower) converts all letters in a string to lowercase.
|
||||
|
|
|
@ -20,7 +20,7 @@ hello
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`trimprefix`](/docs/from-1.5/functions/string/trimprefix) removes a word from the start of a string.
|
||||
- [`trimsuffix`](/docs/from-1.5/functions/string/trimsuffix) removes a word from the end of a string.
|
||||
- [`trimspace`](/docs/from-1.5/functions/string/trimspace) removes all types of whitespace from
|
||||
- [`trimprefix`](//docs/templates/hcl_templates/functions/string/trimprefix) removes a word from the start of a string.
|
||||
- [`trimsuffix`](//docs/templates/hcl_templates/functions/string/trimsuffix) removes a word from the end of a string.
|
||||
- [`trimspace`](//docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from
|
||||
both the start and the end of a string.
|
||||
|
|
|
@ -19,7 +19,7 @@ world
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`trim`](/docs/from-1.5/functions/string/trim) removes characters at the start and end of a string.
|
||||
- [`trimsuffix`](/docs/from-1.5/functions/string/trimsuffix) removes a word from the end of a string.
|
||||
- [`trimspace`](/docs/from-1.5/functions/string/trimspace) removes all types of whitespace from
|
||||
- [`trim`](//docs/templates/hcl_templates/functions/string/trim) removes characters at the start and end of a string.
|
||||
- [`trimsuffix`](//docs/templates/hcl_templates/functions/string/trimsuffix) removes a word from the end of a string.
|
||||
- [`trimspace`](//docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from
|
||||
both the start and the end of a string.
|
||||
|
|
|
@ -24,5 +24,5 @@ hello
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`chomp`](/docs/from-1.5/functions/string/chomp) removes just line ending characters from the _end_ of
|
||||
- [`chomp`](//docs/templates/hcl_templates/functions/string/chomp) removes just line ending characters from the _end_ of
|
||||
a string.
|
||||
|
|
|
@ -19,7 +19,7 @@ hello
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`trim`](/docs/from-1.5/functions/string/trim) removes characters at the start and end of a string.
|
||||
- [`trimprefix`](/docs/from-1.5/functions/string/trimprefix) removes a word from the start of a string.
|
||||
- [`trimspace`](/docs/from-1.5/functions/string/trimspace) removes all types of whitespace from
|
||||
- [`trim`](//docs/templates/hcl_templates/functions/string/trim) removes characters at the start and end of a string.
|
||||
- [`trimprefix`](//docs/templates/hcl_templates/functions/string/trimprefix) removes a word from the start of a string.
|
||||
- [`trimspace`](//docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from
|
||||
both the start and the end of a string.
|
||||
|
|
|
@ -23,5 +23,5 @@ This function uses Unicode's definition of letters and of upper- and lowercase.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`lower`](/docs/from-1.5/functions/string/lower) converts letters in a string to _lowercase_.
|
||||
- [`title`](/docs/from-1.5/functions/string/title) converts the first letter of each word in a string to uppercase.
|
||||
- [`lower`](//docs/templates/hcl_templates/functions/string/lower) converts letters in a string to _lowercase_.
|
||||
- [`title`](//docs/templates/hcl_templates/functions/string/title) converts the first letter of each word in a string to uppercase.
|
||||
|
|
|
@ -25,4 +25,4 @@ b5ee72a3-54dd-c4b8-551c-4bdc0204cedb
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`uuidv5`](/docs/from-1.5/functions/uuid/uuidv5), which generates name-based UUIDs.
|
||||
- [`uuidv5`](//docs/templates/hcl_templates/functions/uuid/uuidv5), which generates name-based UUIDs.
|
||||
|
|
|
@ -16,7 +16,7 @@ description: |-
|
|||
uuidv5(namespace, name)
|
||||
```
|
||||
|
||||
Unlike the pseudo-random UUIDs generated by [`uuidv4`](/docs/from-1.5/functions/uuid/uuidv4),
|
||||
Unlike the pseudo-random UUIDs generated by [`uuidv4`](//docs/templates/hcl_templates/functions/uuid/uuidv4),
|
||||
name-based UUIDs derive from namespace and an name, producing the same UUID
|
||||
value every time if the namespace and name are unchanged.
|
||||
|
||||
|
@ -76,4 +76,4 @@ human-significant manner, such as by reference to the standard that defined it.
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`uuidv4`](/docs/from-1.5/functions/uuid), which generates pseudorandom UUIDs.
|
||||
- [`uuidv4`](//docs/templates/hcl_templates/functions/uuid), which generates pseudorandom UUIDs.
|
||||
|
|
|
@ -56,14 +56,14 @@ source "amazon-ebs" "main" {
|
|||
|
||||
For full details about Packer's syntax, see:
|
||||
|
||||
- [Configuration Syntax](/docs/from-1.5/syntax)
|
||||
- [Expressions](/docs/from-1.5/expressions)
|
||||
- [Configuration Syntax](//docs/templates/hcl_templates/syntax)
|
||||
- [Expressions](//docs/templates/hcl_templates/expressions)
|
||||
|
||||
## Code Organization
|
||||
|
||||
The HCL language uses configuration files that are named with the `.pkr.hcl`
|
||||
file extension. There is also [a JSON-based variant of the
|
||||
language](/docs/from-1.5/syntax-json) that is named with the `.pkr.json` file
|
||||
language](//docs/templates/hcl_templates/syntax-json) that is named with the `.pkr.json` file
|
||||
extension.
|
||||
|
||||
Configuration files must always use UTF-8 encoding, and by convention are
|
||||
|
|
|
@ -13,7 +13,7 @@ description: >-
|
|||
Local values assign a name to an expression, that can then be used multiple
|
||||
times within a folder.
|
||||
|
||||
If [variables](/docs/from-1.5/variables) are analogous to function arguments then
|
||||
If [variables](//docs/templates/hcl_templates/variables) are analogous to function arguments then
|
||||
_local values_ are comparable to a function's local variables.
|
||||
|
||||
Input variable and local variable usage are introduced in the [_Variables
|
||||
|
|
|
@ -24,16 +24,16 @@ locals {
|
|||
|
||||
## Related Functions
|
||||
|
||||
- [`abspath`](/docs/from-1.5/functions/file/abspath) takes a string containing
|
||||
- [`abspath`](//docs/templates/hcl_templates/functions/file/abspath) takes a string containing
|
||||
a filesystem path and converts it to an absolute path.
|
||||
|
||||
- [`basename`](/docs/from-1.5/functions/file/basename) returns _only_ the last
|
||||
- [`basename`](//docs/templates/hcl_templates/functions/file/basename) returns _only_ the last
|
||||
portion of a filesystem path, discarding the portion that would be returned
|
||||
by `dirname`.
|
||||
|
||||
- [`fileset`](/docs/from-1.5/functions/file/fileset) enumerates a set of
|
||||
- [`fileset`](//docs/templates/hcl_templates/functions/file/fileset) enumerates a set of
|
||||
regular file names given a path and pattern.
|
||||
|
||||
- [`dirname`](/docs/from-1.5/functions/file/dirname) returns all of the
|
||||
- [`dirname`](//docs/templates/hcl_templates/functions/file/dirname) returns all of the
|
||||
segments of a filesystem path _except_ the last, discarding the portion that
|
||||
would be returned by `basename`.
|
||||
|
|
|
@ -11,7 +11,7 @@ description: |-
|
|||
`@include 'from-1.5/beta-hcl2-note.mdx'`
|
||||
|
||||
Most Packer configurations are written in [the native HCL
|
||||
syntax](/docs/from-1.5/syntax), which is designed to be easy for humans to read and
|
||||
syntax](//docs/templates/hcl_templates/syntax), which is designed to be easy for humans to read and
|
||||
update.
|
||||
|
||||
Packer also supports an alternative syntax that is JSON-compatible. This
|
||||
|
@ -97,7 +97,7 @@ different (see [block-type-specific exceptions](#block-type-specific-exceptions)
|
|||
correspond either to argument names or to nested block type names.
|
||||
|
||||
- Where a property corresponds to an argument that accepts
|
||||
[arbitrary expressions](/docs/from-1.5/expressions) in the native syntax, the
|
||||
[arbitrary expressions](//docs/templates/hcl_templates/expressions) in the native syntax, the
|
||||
property value is mapped to an expression as described under
|
||||
[_Expression Mapping_](#expression-mapping) below. For arguments that
|
||||
do _not_ accept arbitrary expressions, the interpretation of the property
|
||||
|
@ -114,20 +114,20 @@ different (see [block-type-specific exceptions](#block-type-specific-exceptions)
|
|||
## Expression Mapping
|
||||
|
||||
Since JSON grammar is not able to represent all of the Packer language
|
||||
[expression syntax](/docs/from-1.5/expressions), JSON values interpreted as expressions
|
||||
[expression syntax](//docs/templates/hcl_templates/expressions), JSON values interpreted as expressions
|
||||
are mapped as follows:
|
||||
|
||||
| JSON | Packer Language Interpretation |
|
||||
| ------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| Boolean | A literal `bool` value. |
|
||||
| Number | A literal `number` value. |
|
||||
| String | Parsed as a [string template](/docs/from-1.5/expressions#string-templates) and then evaluated as described below. |
|
||||
| String | Parsed as a [string template](//docs/templates/hcl_templates/expressions#string-templates) and then evaluated as described below. |
|
||||
| Object | Each property value is mapped per this table, producing an `object(...)` value with suitable attribute types. |
|
||||
| Array | Each element is mapped per this table, producing a `tuple(...)` value with suitable element types. |
|
||||
| Null | A literal `null`. |
|
||||
|
||||
When a JSON string is encountered in a location where arbitrary expressions are
|
||||
expected, its value is first parsed as a [string template](/docs/from-1.5/expressions#string-templates)
|
||||
expected, its value is first parsed as a [string template](//docs/templates/hcl_templates/expressions#string-templates)
|
||||
and then it is evaluated to produce the final result.
|
||||
|
||||
If the given template consists _only_ of a single interpolation sequence,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue