diff --git a/CHANGELOG.md b/CHANGELOG.md index 54097647e..c387bf374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/builder/alicloud/ecs/image_config.go b/builder/alicloud/ecs/image_config.go index 69b452316..c39d4c96c 100644 --- a/builder/alicloud/ecs/image_config.go +++ b/builder/alicloud/ecs/image_config.go @@ -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"` diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index 23d5be8f4..450963978 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -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 diff --git a/builder/amazon/common/ami_config.go b/builder/amazon/common/ami_config.go index 2f9620bd2..3fb103a4f 100644 --- a/builder/amazon/common/ami_config.go +++ b/builder/amazon/common/ami_config.go @@ -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 diff --git a/builder/amazon/common/run_config.go b/builder/amazon/common/run_config.go index d64f8f2ef..c64ce1337 100644 --- a/builder/amazon/common/run_config.go +++ b/builder/amazon/common/run_config.go @@ -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. diff --git a/builder/amazon/ebs/builder.go b/builder/amazon/ebs/builder.go index 106b52f9b..d7c387ace 100644 --- a/builder/amazon/ebs/builder.go +++ b/builder/amazon/ebs/builder.go @@ -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 diff --git a/builder/amazon/ebssurrogate/builder.go b/builder/amazon/ebssurrogate/builder.go index 1d02ec505..4c5387442 100644 --- a/builder/amazon/ebssurrogate/builder.go +++ b/builder/amazon/ebssurrogate/builder.go @@ -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 diff --git a/builder/amazon/ebsvolume/block_device.go b/builder/amazon/ebsvolume/block_device.go index a16b90344..f82803d94 100644 --- a/builder/amazon/ebsvolume/block_device.go +++ b/builder/amazon/ebsvolume/block_device.go @@ -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"` } diff --git a/builder/amazon/ebsvolume/builder.go b/builder/amazon/ebsvolume/builder.go index 5ef27ec77..0115d9e54 100644 --- a/builder/amazon/ebsvolume/builder.go +++ b/builder/amazon/ebsvolume/builder.go @@ -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"` diff --git a/builder/azure/arm/config.go b/builder/azure/arm/config.go index 366b893b7..0e7382be9 100644 --- a/builder/azure/arm/config.go +++ b/builder/azure/arm/config.go @@ -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. diff --git a/builder/hyperone/config.go b/builder/hyperone/config.go index 80c8e5d45..c63f6d273 100644 --- a/builder/hyperone/config.go +++ b/builder/hyperone/config.go @@ -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. diff --git a/builder/tencentcloud/cvm/run_config.go b/builder/tencentcloud/cvm/run_config.go index 65979e974..46256adcf 100644 --- a/builder/tencentcloud/cvm/run_config.go +++ b/builder/tencentcloud/cvm/run_config.go @@ -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"` diff --git a/builder/triton/source_machine_config.go b/builder/triton/source_machine_config.go index 17f0f7553..0387a6624 100644 --- a/builder/triton/source_machine_config.go +++ b/builder/triton/source_machine_config.go @@ -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 diff --git a/builder/triton/target_image_config.go b/builder/triton/target_image_config.go index 5a90a18c6..d5df9900b 100644 --- a/builder/triton/target_image_config.go +++ b/builder/triton/target_image_config.go @@ -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"` } diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index 595a7f0df..44c2f6600 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -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 { diff --git a/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl index e36324971..758b302ed 100644 --- a/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl @@ -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 : 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 : 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 : 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 : 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 : 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 : 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 }}"] } diff --git a/hcl2template/types.variables.go b/hcl2template/types.variables.go index ede4a014c..08dd47393 100644 --- a/hcl2template/types.variables.go +++ b/hcl2template/types.variables.go @@ -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(), }} diff --git a/hcl2template/version.go b/hcl2template/version.go index 1b2514533..4a9bb992f 100644 --- a/hcl2template/version.go +++ b/hcl2template/version.go @@ -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 diff --git a/mlc_config.json b/mlc_config.json index 0a10332ec..f5977578f 100644 --- a/mlc_config.json +++ b/mlc_config.json @@ -11,6 +11,15 @@ }, { "pattern": "^https://github.com/hashicorp/packer-plugin-scaffolding" + }, + { + "pattern": "^https://www.packer.io/docs/templates/hcl_templates/" + }, + { + "pattern": "^https://packer.io/docs/templates/hcl_templates/" + }, + { + "pattern": "^/docs/templates/hcl_templates/" } ], "replacementPatterns": [ diff --git a/website/content/docs/builders/amazon/chroot.mdx b/website/content/docs/builders/amazon/chroot.mdx index c5aca27ff..373e9727c 100644 --- a/website/content/docs/builders/amazon/chroot.mdx +++ b/website/content/docs/builders/amazon/chroot.mdx @@ -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: diff --git a/website/content/docs/builders/amazon/ebs.mdx b/website/content/docs/builders/amazon/ebs.mdx index c0f018f75..e54647154 100644 --- a/website/content/docs/builders/amazon/ebs.mdx +++ b/website/content/docs/builders/amazon/ebs.mdx @@ -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: diff --git a/website/content/docs/builders/amazon/ebssurrogate.mdx b/website/content/docs/builders/amazon/ebssurrogate.mdx index 3f555396e..b17aca88d 100644 --- a/website/content/docs/builders/amazon/ebssurrogate.mdx +++ b/website/content/docs/builders/amazon/ebssurrogate.mdx @@ -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: diff --git a/website/content/docs/builders/amazon/ebsvolume.mdx b/website/content/docs/builders/amazon/ebsvolume.mdx index 158649e3c..6eba6a866 100644 --- a/website/content/docs/builders/amazon/ebsvolume.mdx +++ b/website/content/docs/builders/amazon/ebsvolume.mdx @@ -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: diff --git a/website/content/docs/builders/amazon/instance.mdx b/website/content/docs/builders/amazon/instance.mdx index 1474a4f59..876c0cf75 100644 --- a/website/content/docs/builders/amazon/instance.mdx +++ b/website/content/docs/builders/amazon/instance.mdx @@ -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: diff --git a/website/content/docs/builders/docker.mdx b/website/content/docs/builders/docker.mdx index 8b528e08a..b29b93c2a 100644 --- a/website/content/docs/builders/docker.mdx +++ b/website/content/docs/builders/docker.mdx @@ -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: diff --git a/website/content/docs/builders/vmware/vsphere-clone.mdx b/website/content/docs/builders/vmware/vsphere-clone.mdx index 4fd74c314..43ea9b6f4 100644 --- a/website/content/docs/builders/vmware/vsphere-clone.mdx +++ b/website/content/docs/builders/vmware/vsphere-clone.mdx @@ -15,7 +15,7 @@ Type: `vsphere-clone` This builder clones VMs from existing templates. - VMware Player is not required. -- It uses the official vCenter API, and does not require ESXi host [modification](https://www.packer.io/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor) +- It uses the official vCenter API, and does not require ESXi host [modification](/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor) - This builder is supported for vSphere version 6.5 and greater. Builds on lower versions may work, but some configuration options may throw errors because they do not exist in the older versions of the vSphere API. diff --git a/website/content/docs/builders/yandex.mdx b/website/content/docs/builders/yandex.mdx index f023cdc82..ae427de3f 100644 --- a/website/content/docs/builders/yandex.mdx +++ b/website/content/docs/builders/yandex.mdx @@ -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 diff --git a/website/content/docs/commands/console.mdx b/website/content/docs/commands/console.mdx index 4462f52bf..779170460 100644 --- a/website/content/docs/commands/console.mdx +++ b/website/content/docs/commands/console.mdx @@ -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 diff --git a/website/content/docs/commands/hcl2_upgrade.mdx b/website/content/docs/commands/hcl2_upgrade.mdx index 0de5d4e85..3a974d7f5 100644 --- a/website/content/docs/commands/hcl2_upgrade.mdx +++ b/website/content/docs/commands/hcl2_upgrade.mdx @@ -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](/docs/templates/hcl_templates/variables#environment-variables) for more info. - `{{ timestamp }}` becomes `${local.timestamp}`, the local variable will be created for all generated files. diff --git a/website/content/docs/core-configuration.mdx b/website/content/docs/core-configuration.mdx index 5a3849f58..ff451986d 100644 --- a/website/content/docs/core-configuration.mdx +++ b/website/content/docs/core-configuration.mdx @@ -33,7 +33,7 @@ The format of the configuration file is basic JSON. ## Configuration Reference Below is the list of all available configuration parameters for the core -configuration file. None of these are required, since all have sane defaults. +configuration file. None of these are required, since all have defaults. - `plugin_min_port` and `plugin_max_port` (number) - These are the minimum and maximum ports that Packer uses for communication with plugins, since diff --git a/website/content/docs/extending/custom-builders.mdx b/website/content/docs/extending/custom-builders.mdx index c8999e9bd..546ab9b93 100644 --- a/website/content/docs/extending/custom-builders.mdx +++ b/website/content/docs/extending/custom-builders.mdx @@ -204,8 +204,8 @@ 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). +Json template `build` docs are [here](/docs/templates/engine#build) +and HCL template build docs are [here](/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 diff --git a/website/content/docs/from-1.5/blocks/index.mdx b/website/content/docs/from-1.5/blocks/index.mdx deleted file mode 100644 index 434f6f342..000000000 --- a/website/content/docs/from-1.5/blocks/index.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -page_title: Blocks - Configuration Language -sidebar_title: Blocks -description: The HCL language has a number of blocks that can be used to configure builds. ---- - -# Built-in Blocks - -`@include 'from-1.5/beta-hcl2-note.mdx'` - -The Packer - HCL2 language includes a number of built-in blocks that you can -use. A block is a container for configuration. - -Blocks can be defined in multiple files and `packer build folder` will build -using solely the files from a directory named `folder`. - -Packer does not support user-defined blocks and so only the blocks built in to -the language are available for use. The navigation for this section includes a -list of all of the available built-in HCL2 blocks. - -## Config example: - -`@include 'from-1.5/variables/foo-block.mdx'` - -- [Variable block documentation](/docs/from-1.5/blocks/variable). - -`@include 'from-1.5/locals/example-block.mdx'` - -- [Locals block documentation](/docs/from-1.5/blocks/locals). - -`@include 'from-1.5/sources/example-block.mdx'` - -- [source block documentation](/docs/from-1.5/blocks/source). - -`@include 'from-1.5/builds/example-block.mdx'` - -- [build block documentation](/docs/from-1.5/blocks/build). diff --git a/website/content/docs/post-processors/googlecompute-export.mdx b/website/content/docs/post-processors/googlecompute-export.mdx index 6041b5287..408767671 100644 --- a/website/content/docs/post-processors/googlecompute-export.mdx +++ b/website/content/docs/post-processors/googlecompute-export.mdx @@ -26,7 +26,7 @@ As such, the authentication credentials that built the image must have write permissions to the GCS `paths`. ~> **Note**: By default the GCE image being exported will be deleted once the image has been exported. -To prevent Packer from deleting the image set the `keep_input_artifact` configuration option to `true`. See [Post-Processor Input Artifacts](https://www.packer.io/docs/templates/post-processors#input-artifacts) for more details. +To prevent Packer from deleting the image set the `keep_input_artifact` configuration option to `true`. See [Post-Processor Input Artifacts](/docs/templates/post-processors#input-artifacts) for more details. ## Configuration diff --git a/website/content/docs/post-processors/googlecompute-import.mdx b/website/content/docs/post-processors/googlecompute-import.mdx index 60fc97250..fea6c6963 100644 --- a/website/content/docs/post-processors/googlecompute-import.mdx +++ b/website/content/docs/post-processors/googlecompute-import.mdx @@ -29,7 +29,7 @@ see the [GCE import documentation](https://cloud.google.com/compute/docs/images/ for details. ~> **Note**: To prevent Packer from deleting the compressed RAW disk image set the `keep_input_artifact` configuration option to `true`. -See [Post-Processor Input Artifacts](https://www.packer.io/docs/templates/post-processors#input-artifacts) for more details. +See [Post-Processor Input Artifacts](/docs/templates/post-processors#input-artifacts) for more details. ## Configuration diff --git a/website/content/docs/post-processors/vagrant.mdx b/website/content/docs/post-processors/vagrant.mdx index 3811be8eb..bc2256545 100644 --- a/website/content/docs/post-processors/vagrant.mdx +++ b/website/content/docs/post-processors/vagrant.mdx @@ -26,7 +26,7 @@ If you've never used a post-processor before, please read the documentation on This knowledge will be expected for the remainder of this document. Because Vagrant boxes are -[provider-specific](https://docs.vagrantup.com/v2/boxes/format.html), the +[provider-specific](https://www.vagrantup.com/docs/boxes/format), the Vagrant post-processor is hardcoded to understand how to convert the artifacts of certain builders into proper boxes for their respective providers. @@ -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 diff --git a/website/content/docs/from-1.5/blocks/build/index.mdx b/website/content/docs/templates/hcl_templates/blocks/build/index.mdx similarity index 93% rename from website/content/docs/from-1.5/blocks/build/index.mdx rename to website/content/docs/templates/hcl_templates/blocks/build/index.mdx index 5c8834c56..b6d042320 100644 --- a/website/content/docs/from-1.5/blocks/build/index.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/index.mdx @@ -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. diff --git a/website/content/docs/from-1.5/blocks/build/post-processor.mdx b/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx similarity index 90% rename from website/content/docs/from-1.5/blocks/build/post-processor.mdx rename to website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx index e59f19b03..0ac71453e 100644 --- a/website/content/docs/from-1.5/blocks/build/post-processor.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx @@ -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. diff --git a/website/content/docs/from-1.5/blocks/build/post-processors.mdx b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx similarity index 91% rename from website/content/docs/from-1.5/blocks/build/post-processors.mdx rename to website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx index ccaa4a40e..60e3491e4 100644 --- a/website/content/docs/from-1.5/blocks/build/post-processors.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx @@ -11,7 +11,7 @@ sidebar_title: post-processors `@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. diff --git a/website/content/docs/from-1.5/blocks/build/provisioner.mdx b/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx similarity index 96% rename from website/content/docs/from-1.5/blocks/build/provisioner.mdx rename to website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx index d2e0441fa..89e749b40 100644 --- a/website/content/docs/from-1.5/blocks/build/provisioner.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx @@ -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. diff --git a/website/content/docs/from-1.5/blocks/build/source.mdx b/website/content/docs/templates/hcl_templates/blocks/build/source.mdx similarity index 100% rename from website/content/docs/from-1.5/blocks/build/source.mdx rename to website/content/docs/templates/hcl_templates/blocks/build/source.mdx diff --git a/website/content/docs/templates/hcl_templates/blocks/index.mdx b/website/content/docs/templates/hcl_templates/blocks/index.mdx new file mode 100644 index 000000000..ddd9bc245 --- /dev/null +++ b/website/content/docs/templates/hcl_templates/blocks/index.mdx @@ -0,0 +1,59 @@ +--- +page_title: Blocks - Configuration Language +sidebar_title: Blocks +description: The HCL language has a number of blocks that can be used to configure builds. +--- + +# Built-in Blocks + +`@include 'from-1.5/beta-hcl2-note.mdx'` + +The Packer - HCL2 language includes a number of built-in blocks that you can +use to configure builds. A block is a container for configuration. + +The most important blocks can be broken into a couple of major types: + * `build` blocks contain configuration for a specific combination of builders, + provisioners, and post-processors used to create a specific image artifact. + * `source` blocks contain configuration for builder plugins. Once defined, + sources can be used and further configured by the "build" block. + * `provisioner` blocks contain configuration for provisioner plugins. These + blocks are nested inside of a build block. + * `post-processor` and `post-processors` blocks contain configuration for + post-processor plugins and post-processor plugin sequences. They are also + nested within `build` blocks. + * `variable` blocks contain configuration for variables that can either be + defaulted in configuration or set by the user at runtime. + * `locals` blocks contain configuration for variables that can be created using + HCL functions or data sources, or composited from variables created in the + variables blocks. + +Use the sidebar to navigate to detailed documentation for each of these blocks. + +Other blocks, such as the "packer" block, provide information to the Packer core +about what version it is allowed to run. The "required_plugins" block helps the +Packer core + +Blocks can be defined in multiple files and `packer build folder` will build +using solely the files from a directory named `folder`. + +Packer does not support user-defined blocks and so only the blocks built in to +the language are available for use. The navigation for this section includes a +list of all of the available built-in HCL2 blocks. + +## Config example: + +`@include 'from-1.5/variables/foo-block.mdx'` + +- [Variable block documentation](/docs/templates/hcl_templates/blocks/variable). + +`@include 'from-1.5/locals/example-block.mdx'` + +- [Locals block documentation](/docs/templates/hcl_templates/blocks/locals). + +`@include 'from-1.5/sources/example-block.mdx'` + +- [source block documentation](/docs/templates/hcl_templates/blocks/source). + +`@include 'from-1.5/builds/example-block.mdx'` + +- [build block documentation](/docs/templates/hcl_templates/blocks/build). diff --git a/website/content/docs/from-1.5/blocks/locals.mdx b/website/content/docs/templates/hcl_templates/blocks/locals.mdx similarity index 85% rename from website/content/docs/from-1.5/blocks/locals.mdx rename to website/content/docs/templates/hcl_templates/blocks/locals.mdx index 427f681e2..fbe027dec 100644 --- a/website/content/docs/from-1.5/blocks/locals.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/locals.mdx @@ -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. diff --git a/website/content/docs/from-1.5/blocks/packer.mdx b/website/content/docs/templates/hcl_templates/blocks/packer.mdx similarity index 97% rename from website/content/docs/from-1.5/blocks/packer.mdx rename to website/content/docs/templates/hcl_templates/blocks/packer.mdx index 41dedd227..5dbcdec30 100644 --- a/website/content/docs/from-1.5/blocks/packer.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/packer.mdx @@ -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. diff --git a/website/content/docs/from-1.5/blocks/source.mdx b/website/content/docs/templates/hcl_templates/blocks/source.mdx similarity index 87% rename from website/content/docs/from-1.5/blocks/source.mdx rename to website/content/docs/templates/hcl_templates/blocks/source.mdx index f9bb2358b..1f91da94c 100644 --- a/website/content/docs/from-1.5/blocks/source.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/source.mdx @@ -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 diff --git a/website/content/docs/from-1.5/blocks/variable.mdx b/website/content/docs/templates/hcl_templates/blocks/variable.mdx similarity index 83% rename from website/content/docs/from-1.5/blocks/variable.mdx rename to website/content/docs/templates/hcl_templates/blocks/variable.mdx index c3926148b..946637c05 100644 --- a/website/content/docs/from-1.5/blocks/variable.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/variable.mdx @@ -12,7 +12,7 @@ sidebar_title: variable 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'` @@ -35,6 +35,6 @@ Example of a variable assignment from a file: # More on variables -- Read the [full variables](/docs/from-1.5/variables) description for a more +- Read the [full variables](/docs/templates/hcl_templates/variables) description for a more thorough read. - Read the [variables guide](/guides/hcl/variables) for more examples. diff --git a/website/content/docs/from-1.5/contextual-variables.mdx b/website/content/docs/templates/hcl_templates/contextual-variables.mdx similarity index 96% rename from website/content/docs/from-1.5/contextual-variables.mdx rename to website/content/docs/templates/hcl_templates/contextual-variables.mdx index ac9a1f7b3..1bc7152c9 100644 --- a/website/content/docs/from-1.5/contextual-variables.mdx +++ b/website/content/docs/templates/hcl_templates/contextual-variables.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" { diff --git a/website/content/docs/from-1.5/expressions.mdx b/website/content/docs/templates/hcl_templates/expressions.mdx similarity index 97% rename from website/content/docs/from-1.5/expressions.mdx rename to website/content/docs/templates/hcl_templates/expressions.mdx index 2df520326..9156397d3 100644 --- a/website/content/docs/from-1.5/expressions.mdx +++ b/website/content/docs/templates/hcl_templates/expressions.mdx @@ -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..` 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 diff --git a/website/content/docs/from-1.5/functions/collection/chunklist.mdx b/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/chunklist.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx diff --git a/website/content/docs/from-1.5/functions/collection/coalesce.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx similarity index 85% rename from website/content/docs/from-1.5/functions/collection/coalesce.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx index 09ddfcb94..a32c6d62d 100644 --- a/website/content/docs/from-1.5/functions/collection/coalesce.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/coalescelist.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx similarity index 86% rename from website/content/docs/from-1.5/functions/collection/coalescelist.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx index 29322735c..d849889e4 100644 --- a/website/content/docs/from-1.5/functions/collection/coalescelist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/compact.mdx b/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/compact.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/compact.mdx diff --git a/website/content/docs/from-1.5/functions/collection/concat.mdx b/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/concat.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/concat.mdx diff --git a/website/content/docs/from-1.5/functions/collection/contains.mdx b/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/contains.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/contains.mdx diff --git a/website/content/docs/from-1.5/functions/collection/distinct.mdx b/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/distinct.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx diff --git a/website/content/docs/from-1.5/functions/collection/element.mdx b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx similarity index 76% rename from website/content/docs/from-1.5/functions/collection/element.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/element.mdx index ee9c463b2..e9ebe4030 100644 --- a/website/content/docs/from-1.5/functions/collection/element.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx @@ -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_. diff --git a/website/content/docs/from-1.5/functions/collection/flatten.mdx b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx similarity index 94% rename from website/content/docs/from-1.5/functions/collection/flatten.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx index c917cf239..4192ee993 100644 --- a/website/content/docs/from-1.5/functions/collection/flatten.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/index-fn.mdx b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx similarity index 80% rename from website/content/docs/from-1.5/functions/collection/index-fn.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx index c57c3dcac..4f49f4691 100644 --- a/website/content/docs/from-1.5/functions/collection/index-fn.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/index.mdx b/website/content/docs/templates/hcl_templates/functions/collection/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/index.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/index.mdx diff --git a/website/content/docs/from-1.5/functions/collection/keys.mdx b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx similarity index 81% rename from website/content/docs/from-1.5/functions/collection/keys.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/keys.mdx index 2929c2ac5..8130d1473 100644 --- a/website/content/docs/from-1.5/functions/collection/keys.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/length.mdx b/website/content/docs/templates/hcl_templates/functions/collection/length.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/length.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/length.mdx diff --git a/website/content/docs/from-1.5/functions/collection/lookup.mdx b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx similarity index 85% rename from website/content/docs/from-1.5/functions/collection/lookup.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx index 3edd9a77e..d7589523c 100644 --- a/website/content/docs/from-1.5/functions/collection/lookup.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx @@ -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_. diff --git a/website/content/docs/from-1.5/functions/collection/merge.mdx b/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/merge.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/merge.mdx diff --git a/website/content/docs/from-1.5/functions/collection/range.mdx b/website/content/docs/templates/hcl_templates/functions/collection/range.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/range.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/range.mdx diff --git a/website/content/docs/from-1.5/functions/collection/reverse.mdx b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx similarity index 82% rename from website/content/docs/from-1.5/functions/collection/reverse.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx index 66a9c4d5a..9fc6a79a0 100644 --- a/website/content/docs/from-1.5/functions/collection/reverse.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/setintersection.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx similarity index 72% rename from website/content/docs/from-1.5/functions/collection/setintersection.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx index a744c1a85..f337bc2e5 100644 --- a/website/content/docs/from-1.5/functions/collection/setintersection.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/setproduct.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx similarity index 91% rename from website/content/docs/from-1.5/functions/collection/setproduct.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx index aaaef049c..f5c7cce92 100644 --- a/website/content/docs/from-1.5/functions/collection/setproduct.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/setunion.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx similarity index 69% rename from website/content/docs/from-1.5/functions/collection/setunion.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx index 1080c34d2..5b520e60f 100644 --- a/website/content/docs/from-1.5/functions/collection/setunion.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/slice.mdx b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx similarity index 84% rename from website/content/docs/from-1.5/functions/collection/slice.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/slice.mdx index 3b9dbf873..1ac456abd 100644 --- a/website/content/docs/from-1.5/functions/collection/slice.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/sort.mdx b/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/sort.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/sort.mdx diff --git a/website/content/docs/from-1.5/functions/collection/values.mdx b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx similarity index 74% rename from website/content/docs/from-1.5/functions/collection/values.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/values.mdx index 17221b555..56ee00264 100644 --- a/website/content/docs/from-1.5/functions/collection/values.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/collection/zipmap.mdx b/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/collection/zipmap.mdx rename to website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx diff --git a/website/content/docs/from-1.5/functions/contextual/aws_secretsmanager.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/contextual/aws_secretsmanager.mdx rename to website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx diff --git a/website/content/docs/from-1.5/functions/contextual/consul.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/contextual/consul.mdx rename to website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx diff --git a/website/content/docs/from-1.5/functions/contextual/env.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx similarity index 90% rename from website/content/docs/from-1.5/functions/contextual/env.mdx rename to website/content/docs/templates/hcl_templates/functions/contextual/env.mdx index 43eecc5e1..3f9f447b4 100644 --- a/website/content/docs/from-1.5/functions/contextual/env.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx @@ -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 diff --git a/website/content/docs/from-1.5/functions/contextual/index.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/contextual/index.mdx rename to website/content/docs/templates/hcl_templates/functions/contextual/index.mdx diff --git a/website/content/docs/from-1.5/functions/contextual/vault.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/contextual/vault.mdx rename to website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx diff --git a/website/content/docs/from-1.5/functions/conversion/can.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx similarity index 84% rename from website/content/docs/from-1.5/functions/conversion/can.mdx rename to website/content/docs/templates/hcl_templates/functions/conversion/can.mdx index 0e08b60af..af820b188 100644 --- a/website/content/docs/from-1.5/functions/conversion/can.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/conversion/convert.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/conversion/convert.mdx rename to website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx diff --git a/website/content/docs/from-1.5/functions/conversion/index.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/conversion/index.mdx rename to website/content/docs/templates/hcl_templates/functions/conversion/index.mdx diff --git a/website/content/docs/from-1.5/functions/conversion/try.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx similarity index 97% rename from website/content/docs/from-1.5/functions/conversion/try.mdx rename to website/content/docs/templates/hcl_templates/functions/conversion/try.mdx index 61c7f722e..73ee55086 100644 --- a/website/content/docs/from-1.5/functions/conversion/try.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/crypto/bcrypt.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/crypto/bcrypt.mdx rename to website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx diff --git a/website/content/docs/from-1.5/functions/crypto/index.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/crypto/index.mdx rename to website/content/docs/templates/hcl_templates/functions/crypto/index.mdx diff --git a/website/content/docs/from-1.5/functions/crypto/md5.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/crypto/md5.mdx rename to website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx diff --git a/website/content/docs/from-1.5/functions/crypto/rsadecrypt.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/crypto/rsadecrypt.mdx rename to website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx diff --git a/website/content/docs/from-1.5/functions/crypto/sha1.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/crypto/sha1.mdx rename to website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx diff --git a/website/content/docs/from-1.5/functions/crypto/sha256.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/crypto/sha256.mdx rename to website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx diff --git a/website/content/docs/from-1.5/functions/crypto/sha512.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/crypto/sha512.mdx rename to website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx diff --git a/website/content/docs/from-1.5/functions/datetime/formatdate.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx similarity index 95% rename from website/content/docs/from-1.5/functions/datetime/formatdate.mdx rename to website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx index e2563d5c7..43dd61746 100644 --- a/website/content/docs/from-1.5/functions/datetime/formatdate.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx @@ -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`. diff --git a/website/content/docs/from-1.5/functions/datetime/index.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/datetime/index.mdx rename to website/content/docs/templates/hcl_templates/functions/datetime/index.mdx diff --git a/website/content/docs/from-1.5/functions/datetime/timeadd.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx similarity index 91% rename from website/content/docs/from-1.5/functions/datetime/timeadd.mdx rename to website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx index 49b42a0e7..885a39cc0 100644 --- a/website/content/docs/from-1.5/functions/datetime/timeadd.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx @@ -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 diff --git a/website/content/docs/from-1.5/functions/datetime/timestamp.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx similarity index 81% rename from website/content/docs/from-1.5/functions/datetime/timestamp.mdx rename to website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx index 620ad8ea0..935229f86 100644 --- a/website/content/docs/from-1.5/functions/datetime/timestamp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/encoding/base64decode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx similarity index 91% rename from website/content/docs/from-1.5/functions/encoding/base64decode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx index 05272ee34..614fbe7ea 100644 --- a/website/content/docs/from-1.5/functions/encoding/base64decode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/encoding/base64encode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx similarity index 91% rename from website/content/docs/from-1.5/functions/encoding/base64encode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx index ee49a3ad4..7592924f8 100644 --- a/website/content/docs/from-1.5/functions/encoding/base64encode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/encoding/csvdecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/encoding/csvdecode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx diff --git a/website/content/docs/from-1.5/functions/encoding/index.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/encoding/index.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/index.mdx diff --git a/website/content/docs/from-1.5/functions/encoding/jsondecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx similarity index 87% rename from website/content/docs/from-1.5/functions/encoding/jsondecode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx index 2cce23151..5f80eb349 100644 --- a/website/content/docs/from-1.5/functions/encoding/jsondecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/encoding/jsonencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx similarity index 84% rename from website/content/docs/from-1.5/functions/encoding/jsonencode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx index 56a92a550..39e0e066c 100644 --- a/website/content/docs/from-1.5/functions/encoding/jsonencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/encoding/urlencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/encoding/urlencode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx diff --git a/website/content/docs/from-1.5/functions/encoding/yamldecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx similarity index 90% rename from website/content/docs/from-1.5/functions/encoding/yamldecode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx index b6e9f275f..8d5b1f06a 100644 --- a/website/content/docs/from-1.5/functions/encoding/yamldecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/encoding/yamlencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx similarity index 82% rename from website/content/docs/from-1.5/functions/encoding/yamlencode.mdx rename to website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx index 8be8b5959..378732916 100644 --- a/website/content/docs/from-1.5/functions/encoding/yamlencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx @@ -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. 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. diff --git a/website/content/docs/from-1.5/functions/file/abspath.mdx b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx similarity index 89% rename from website/content/docs/from-1.5/functions/file/abspath.mdx rename to website/content/docs/templates/hcl_templates/functions/file/abspath.mdx index dd60dceb7..83ef68ae1 100644 --- a/website/content/docs/from-1.5/functions/file/abspath.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx @@ -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 diff --git a/website/content/docs/from-1.5/functions/file/basename.mdx b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx similarity index 84% rename from website/content/docs/from-1.5/functions/file/basename.mdx rename to website/content/docs/templates/hcl_templates/functions/file/basename.mdx index 20d3cdddf..dae3631c4 100644 --- a/website/content/docs/from-1.5/functions/file/basename.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx @@ -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`. diff --git a/website/content/docs/from-1.5/functions/file/dirname.mdx b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx similarity index 85% rename from website/content/docs/from-1.5/functions/file/dirname.mdx rename to website/content/docs/templates/hcl_templates/functions/file/dirname.mdx index 8f067be5f..8c0c2b16c 100644 --- a/website/content/docs/from-1.5/functions/file/dirname.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx @@ -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`. diff --git a/website/content/docs/from-1.5/functions/file/file.mdx b/website/content/docs/templates/hcl_templates/functions/file/file.mdx similarity index 92% rename from website/content/docs/from-1.5/functions/file/file.mdx rename to website/content/docs/templates/hcl_templates/functions/file/file.mdx index 3df9374fa..02a4a1dd3 100644 --- a/website/content/docs/from-1.5/functions/file/file.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/file.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/file/fileexists.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx similarity index 88% rename from website/content/docs/from-1.5/functions/file/fileexists.mdx rename to website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx index ea3a928ee..8acb0565a 100644 --- a/website/content/docs/from-1.5/functions/file/fileexists.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx @@ -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 diff --git a/website/content/docs/from-1.5/functions/file/fileset.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/file/fileset.mdx rename to website/content/docs/templates/hcl_templates/functions/file/fileset.mdx diff --git a/website/content/docs/from-1.5/functions/file/index.mdx b/website/content/docs/templates/hcl_templates/functions/file/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/file/index.mdx rename to website/content/docs/templates/hcl_templates/functions/file/index.mdx diff --git a/website/content/docs/from-1.5/functions/file/pathexpand.mdx b/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/file/pathexpand.mdx rename to website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx diff --git a/website/content/docs/from-1.5/functions/index.mdx b/website/content/docs/templates/hcl_templates/functions/index.mdx similarity index 91% rename from website/content/docs/from-1.5/functions/index.mdx rename to website/content/docs/templates/hcl_templates/functions/index.mdx index d5558f7be..8dd41ea43 100644 --- a/website/content/docs/from-1.5/functions/index.mdx +++ b/website/content/docs/templates/hcl_templates/functions/index.mdx @@ -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 diff --git a/website/content/docs/from-1.5/functions/ipnet/cidrhost.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx similarity index 88% rename from website/content/docs/from-1.5/functions/ipnet/cidrhost.mdx rename to website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx index e1764e32c..50347aeda 100644 --- a/website/content/docs/from-1.5/functions/ipnet/cidrhost.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/ipnet/cidrnetmask.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/ipnet/cidrnetmask.mdx rename to website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx diff --git a/website/content/docs/from-1.5/functions/ipnet/cidrsubnet.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx similarity index 90% rename from website/content/docs/from-1.5/functions/ipnet/cidrsubnet.mdx rename to website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx index 428d51679..5e1ca17bc 100644 --- a/website/content/docs/from-1.5/functions/ipnet/cidrsubnet.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/ipnet/cidrsubnets.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx similarity index 81% rename from website/content/docs/from-1.5/functions/ipnet/cidrsubnets.mdx rename to website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx index 57d757f0d..6eafaf126 100644 --- a/website/content/docs/from-1.5/functions/ipnet/cidrsubnets.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/ipnet/index.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/ipnet/index.mdx rename to website/content/docs/templates/hcl_templates/functions/ipnet/index.mdx diff --git a/website/content/docs/from-1.5/functions/numeric/abs.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/numeric/abs.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx diff --git a/website/content/docs/from-1.5/functions/numeric/ceil.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx similarity index 77% rename from website/content/docs/from-1.5/functions/numeric/ceil.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx index a35345c3a..0267a25fe 100644 --- a/website/content/docs/from-1.5/functions/numeric/ceil.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/numeric/floor.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx similarity index 77% rename from website/content/docs/from-1.5/functions/numeric/floor.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx index c46fe5643..b99be6beb 100644 --- a/website/content/docs/from-1.5/functions/numeric/floor.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/numeric/index.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/numeric/index.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/index.mdx diff --git a/website/content/docs/from-1.5/functions/numeric/log.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/numeric/log.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/log.mdx diff --git a/website/content/docs/from-1.5/functions/numeric/max.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx similarity index 81% rename from website/content/docs/from-1.5/functions/numeric/max.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/max.mdx index 6af969230..dd8120133 100644 --- a/website/content/docs/from-1.5/functions/numeric/max.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/numeric/min.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx similarity index 81% rename from website/content/docs/from-1.5/functions/numeric/min.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/min.mdx index 5489d6b55..a5fd48da1 100644 --- a/website/content/docs/from-1.5/functions/numeric/min.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/numeric/parseint.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx similarity index 90% rename from website/content/docs/from-1.5/functions/numeric/parseint.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx index 1de74f6a6..9a58dcc88 100644 --- a/website/content/docs/from-1.5/functions/numeric/parseint.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/numeric/pow.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/numeric/pow.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx diff --git a/website/content/docs/from-1.5/functions/numeric/signum.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/numeric/signum.mdx rename to website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx diff --git a/website/content/docs/from-1.5/functions/string/chomp.mdx b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx similarity index 81% rename from website/content/docs/from-1.5/functions/string/chomp.mdx rename to website/content/docs/templates/hcl_templates/functions/string/chomp.mdx index ab594f474..509d63a63 100644 --- a/website/content/docs/from-1.5/functions/string/chomp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/format.mdx b/website/content/docs/templates/hcl_templates/functions/string/format.mdx similarity index 95% rename from website/content/docs/from-1.5/functions/string/format.mdx rename to website/content/docs/templates/hcl_templates/functions/string/format.mdx index d3f3f3432..fe0f31971 100644 --- a/website/content/docs/from-1.5/functions/string/format.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/format.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/formatlist.mdx b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx similarity index 85% rename from website/content/docs/from-1.5/functions/string/formatlist.mdx rename to website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx index 97b3637dd..a4bd9584f 100644 --- a/website/content/docs/from-1.5/functions/string/formatlist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/indent.mdx b/website/content/docs/templates/hcl_templates/functions/string/indent.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/string/indent.mdx rename to website/content/docs/templates/hcl_templates/functions/string/indent.mdx diff --git a/website/content/docs/from-1.5/functions/string/index.mdx b/website/content/docs/templates/hcl_templates/functions/string/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/string/index.mdx rename to website/content/docs/templates/hcl_templates/functions/string/index.mdx diff --git a/website/content/docs/from-1.5/functions/string/join.mdx b/website/content/docs/templates/hcl_templates/functions/string/join.mdx similarity index 82% rename from website/content/docs/from-1.5/functions/string/join.mdx rename to website/content/docs/templates/hcl_templates/functions/string/join.mdx index 4f7580af4..56cd19d99 100644 --- a/website/content/docs/from-1.5/functions/string/join.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/join.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/lower.mdx b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx similarity index 65% rename from website/content/docs/from-1.5/functions/string/lower.mdx rename to website/content/docs/templates/hcl_templates/functions/string/lower.mdx index 5c38cd983..b5616a902 100644 --- a/website/content/docs/from-1.5/functions/string/lower.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/regex_replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx similarity index 91% rename from website/content/docs/from-1.5/functions/string/regex_replace.mdx rename to website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx index 6d022d045..6f3a2b48e 100644 --- a/website/content/docs/from-1.5/functions/string/regex_replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx similarity index 83% rename from website/content/docs/from-1.5/functions/string/replace.mdx rename to website/content/docs/templates/hcl_templates/functions/string/replace.mdx index 55475f0f5..1d459a251 100644 --- a/website/content/docs/from-1.5/functions/string/replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/split.mdx b/website/content/docs/templates/hcl_templates/functions/string/split.mdx similarity index 83% rename from website/content/docs/from-1.5/functions/string/split.mdx rename to website/content/docs/templates/hcl_templates/functions/string/split.mdx index 4257f9fa4..540834d3e 100644 --- a/website/content/docs/from-1.5/functions/string/split.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/split.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/strrev.mdx b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx similarity index 84% rename from website/content/docs/from-1.5/functions/string/strrev.mdx rename to website/content/docs/templates/hcl_templates/functions/string/strrev.mdx index 3a5f9f43e..ab4c0cedd 100644 --- a/website/content/docs/from-1.5/functions/string/strrev.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/substr.mdx b/website/content/docs/templates/hcl_templates/functions/string/substr.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/string/substr.mdx rename to website/content/docs/templates/hcl_templates/functions/string/substr.mdx diff --git a/website/content/docs/from-1.5/functions/string/title.mdx b/website/content/docs/templates/hcl_templates/functions/string/title.mdx similarity index 67% rename from website/content/docs/from-1.5/functions/string/title.mdx rename to website/content/docs/templates/hcl_templates/functions/string/title.mdx index 1d9f81f93..fba689afa 100644 --- a/website/content/docs/from-1.5/functions/string/title.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/title.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/trim.mdx b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx similarity index 55% rename from website/content/docs/from-1.5/functions/string/trim.mdx rename to website/content/docs/templates/hcl_templates/functions/string/trim.mdx index 2f1f473fd..843e3c6a3 100644 --- a/website/content/docs/from-1.5/functions/string/trim.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/trimprefix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx similarity index 56% rename from website/content/docs/from-1.5/functions/string/trimprefix.mdx rename to website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx index 00dcbddf8..96602a719 100644 --- a/website/content/docs/from-1.5/functions/string/trimprefix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/trimspace.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx similarity index 82% rename from website/content/docs/from-1.5/functions/string/trimspace.mdx rename to website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx index e0e2a91b5..fe962bf5f 100644 --- a/website/content/docs/from-1.5/functions/string/trimspace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/trimsuffix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx similarity index 56% rename from website/content/docs/from-1.5/functions/string/trimsuffix.mdx rename to website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx index 0ea882385..ac4749761 100644 --- a/website/content/docs/from-1.5/functions/string/trimsuffix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/string/upper.mdx b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx similarity index 65% rename from website/content/docs/from-1.5/functions/string/upper.mdx rename to website/content/docs/templates/hcl_templates/functions/string/upper.mdx index 6145a7db0..b712a2d89 100644 --- a/website/content/docs/from-1.5/functions/string/upper.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/uuid/index.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/index.mdx similarity index 100% rename from website/content/docs/from-1.5/functions/uuid/index.mdx rename to website/content/docs/templates/hcl_templates/functions/uuid/index.mdx diff --git a/website/content/docs/from-1.5/functions/uuid/uuidv4.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx similarity index 88% rename from website/content/docs/from-1.5/functions/uuid/uuidv4.mdx rename to website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx index dd9a0400b..70dbce513 100644 --- a/website/content/docs/from-1.5/functions/uuid/uuidv4.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx @@ -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. diff --git a/website/content/docs/from-1.5/functions/uuid/uuidv5.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx similarity index 93% rename from website/content/docs/from-1.5/functions/uuid/uuidv5.mdx rename to website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx index 8d7341eba..d5935c418 100644 --- a/website/content/docs/from-1.5/functions/uuid/uuidv5.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx @@ -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. diff --git a/website/content/docs/from-1.5/index.mdx b/website/content/docs/templates/hcl_templates/index.mdx similarity index 88% rename from website/content/docs/from-1.5/index.mdx rename to website/content/docs/templates/hcl_templates/index.mdx index 8a4deb8bf..d01c1e482 100644 --- a/website/content/docs/from-1.5/index.mdx +++ b/website/content/docs/templates/hcl_templates/index.mdx @@ -1,10 +1,10 @@ --- -page_title: Configuration Language -sidebar_title: v1.5 Configuration Language +page_title: HCL Templates +sidebar_title: HCL Templates description: |- Packer uses text files to describe infrastructure and to set variables. These text files are called Packer _configurations_ and are - written in the HCL language. + written in the HCL2 HashiCorp Configuration Language. --- # HCL Configuration Language @@ -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 diff --git a/website/content/docs/from-1.5/locals.mdx b/website/content/docs/templates/hcl_templates/locals.mdx similarity index 96% rename from website/content/docs/from-1.5/locals.mdx rename to website/content/docs/templates/hcl_templates/locals.mdx index deb07a961..b601e9174 100644 --- a/website/content/docs/from-1.5/locals.mdx +++ b/website/content/docs/templates/hcl_templates/locals.mdx @@ -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 diff --git a/website/content/docs/from-1.5/onlyexcept.mdx b/website/content/docs/templates/hcl_templates/onlyexcept.mdx similarity index 100% rename from website/content/docs/from-1.5/onlyexcept.mdx rename to website/content/docs/templates/hcl_templates/onlyexcept.mdx diff --git a/website/content/docs/from-1.5/path-variables.mdx b/website/content/docs/templates/hcl_templates/path-variables.mdx similarity index 69% rename from website/content/docs/from-1.5/path-variables.mdx rename to website/content/docs/templates/hcl_templates/path-variables.mdx index e5c17e41f..e29010b4c 100644 --- a/website/content/docs/from-1.5/path-variables.mdx +++ b/website/content/docs/templates/hcl_templates/path-variables.mdx @@ -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`. diff --git a/website/content/docs/from-1.5/syntax-json.mdx b/website/content/docs/templates/hcl_templates/syntax-json.mdx similarity index 95% rename from website/content/docs/from-1.5/syntax-json.mdx rename to website/content/docs/templates/hcl_templates/syntax-json.mdx index f523c5d97..3ae38fd09 100644 --- a/website/content/docs/from-1.5/syntax-json.mdx +++ b/website/content/docs/templates/hcl_templates/syntax-json.mdx @@ -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, diff --git a/website/content/docs/from-1.5/syntax.mdx b/website/content/docs/templates/hcl_templates/syntax.mdx similarity index 96% rename from website/content/docs/from-1.5/syntax.mdx rename to website/content/docs/templates/hcl_templates/syntax.mdx index b16832362..b4f977c3f 100644 --- a/website/content/docs/from-1.5/syntax.mdx +++ b/website/content/docs/templates/hcl_templates/syntax.mdx @@ -18,7 +18,7 @@ are built from. This page describes the _native syntax_ of HCL, which is a rich language designed to be easy for humans to read and write. The constructs in HCL can -also be expressed in [JSON syntax](/docs/from-1.5/syntax-json), which is harder for +also be expressed in [JSON syntax](/docs/templates/hcl_templates/syntax-json), which is harder for humans to read and edit but easier to generate and parse programmatically. This low-level syntax of HCL is defined in terms of a syntax called _HCL_, @@ -48,7 +48,7 @@ after the equals sign is the argument's value. The context where the argument appears determines what value types are valid (for example, each source type has a schema that defines the types of its arguments), but many arguments accept arbitrary -[expressions](/docs/from-1.5/expressions), which allow the value to +[expressions](/docs/templates/hcl_templates/expressions), which allow the value to either be specified literally or generated from other values programmatically. ### Blocks diff --git a/website/content/docs/from-1.5/variables.mdx b/website/content/docs/templates/hcl_templates/variables.mdx similarity index 96% rename from website/content/docs/from-1.5/variables.mdx rename to website/content/docs/templates/hcl_templates/variables.mdx index e9d0f3b34..dd1107b95 100644 --- a/website/content/docs/from-1.5/variables.mdx +++ b/website/content/docs/templates/hcl_templates/variables.mdx @@ -24,7 +24,7 @@ Guide_](/guides/hcl/variables). variable is being discussed. Other kinds of variables in Packer include _environment variables_ (set by the shell where Packer runs) and _expression variables_ (used to indirectly represent a value in an -[expression](/docs/from-1.5/expressions)). +[expression](/docs/templates/hcl_templates/expressions)). ## Declaring an Input Variable @@ -84,7 +84,7 @@ configuration. ## Using Input Variable Values Within the build that declared a variable, its value can be accessed from -within [expressions](/docs/from-1.5/expressions) as `var.`, where `` +within [expressions](/docs/templates/hcl_templates/expressions) as `var.`, where `` matches the label given in the declaration block: ```hcl @@ -100,7 +100,7 @@ the folder where it was declared. ## Type Constraints The `type` argument in a `variable` block allows you to restrict the [type of -value](/docs/from-1.5/expressions#types-and-values) that will be accepted as the value +value](/docs/templates/hcl_templates/expressions#types-and-values) that will be accepted as the value for a variable. If no type constraint is set then a value of any type is accepted. @@ -242,7 +242,7 @@ case letters as in the above example. ### Complex-typed Values When variable values are provided in a variable definitions file, Packer's -[usual syntax](/docs/from-1.5/expressions) can be used to assign +[usual syntax](/docs/templates/hcl_templates/expressions) can be used to assign complex-typed values, like lists and maps. Some special rules apply to the `-var` command line option and to environment diff --git a/website/content/docs/templates/index.mdx b/website/content/docs/templates/index.mdx index 4cf1f8200..e1cedeccb 100644 --- a/website/content/docs/templates/index.mdx +++ b/website/content/docs/templates/index.mdx @@ -1,120 +1,28 @@ --- -description: > - Templates are JSON files that configure the various components of Packer in - - order to create one or more machine images. Templates are portable, static, - and - - readable and writable by both humans and computers. This has the added benefit - - of being able to not only create and modify templates by hand, but also write - - scripts to dynamically create or modify templates. +description: | + This section describes the configruation language used to create Packer + templates. page_title: Templates -sidebar_title: Templates --- -# Templates - -Templates are JSON files that configure the various components of Packer in -order to create one or more machine images. Templates are portable, static, and -readable and writable by both humans and computers. This has the added benefit -of being able to not only create and modify templates by hand, but also write -scripts to dynamically create or modify templates. - -Templates are given to commands such as `packer build`, which will take the -template and actually run the builds within it, producing any resulting machine -images. - -## Template Structure - -A template is a JSON object that has a set of keys configuring various -components of Packer. The available keys within a template are listed below. -Along with each key, it is noted whether it is required or not. - -- `builders` (_required_) is an array of one or more objects that defines the - builders that will be used to create machine images for this template, and - configures each of those builders. For more information on how to define - and configure a builder, read the sub-section on [configuring builders in - templates](/docs/templates/builders). - -- `description` (optional) is a string providing a description of what the - template does. This output is used only in the [inspect - command](/docs/commands/inspect). - -- `min_packer_version` (optional) is a string that has a minimum Packer - version that is required to parse the template. This can be used to ensure - that proper versions of Packer are used with the template. A max version - can't be specified because Packer retains backwards compatibility with - `packer fix`. - -- `post-processors` (optional) is an array of one or more objects that - defines the various post-processing steps to take with the built images. If - not specified, then no post-processing will be done. For more information - on what post-processors do and how they're defined, read the sub-section on - [configuring post-processors in - templates](/docs/templates/post-processors). - -- `provisioners` (optional) is an array of one or more objects that defines - the provisioners that will be used to install and configure software for - the machines created by each of the builders. If it is not specified, then - no provisioners will be run. For more information on how to define and - configure a provisioner, read the sub-section on [configuring provisioners - in templates](/docs/templates/provisioners). - -- `variables` (optional) is an object of one or more key/value strings that - defines user variables contained in the template. If it is not specified, - then no variables are defined. For more information on how to define and - use user variables, read the sub-section on [user variables in - templates](/docs/templates/user-variables). - -## Comments - -JSON doesn't support comments and Packer reports unknown keys as validation -errors. If you'd like to comment your template, you can prefix a _root level_ -key with an underscore. Example: - -```json -{ - "_comment": "This is a comment", - "builders": [{}] -} -``` - -**Important:** Only _root level_ keys can be underscore prefixed. Keys within -builders, provisioners, etc. will still result in validation errors. - -## Example Template +# Packer Templates -Below is an example of a basic template that could be invoked with -`packer build`. It would create an instance in AWS, and once running copy a -script to it and run that script using SSH. +Packer's behavior is determined by the Packer template, which consists of a +series of declarations and commands for Packer to follow. This template tells +Packer what plugins (builders, provisioners, post-proecssors) to use, how to +configure each of those plugins, and what order to run them in. --> **Note:** This example requires an account with Amazon Web Services. -There are a number of parameters which need to be provided for a functional -build to take place. See the [Amazon builder](/docs/builders/amazon) -documentation for more information. +The template contains flexible variable injection tools, as well as built-in +functions to help you customize your builds. -```json -{ - "builders": [ - { - "type": "amazon-ebs", - "access_key": "...", - "secret_key": "...", - "region": "us-east-1", - "source_ami": "ami-fce3c696", - "instance_type": "t2.micro", - "ssh_username": "ubuntu", - "ami_name": "packer {{timestamp}}" - } - ], +Historically, Packer has used a JSON template for its configuration, but Packer +is transitioning to a new template configuration format that uses HCL2 -- the +same configuration language used by Terraform and HashiCorp's other products. +This format is more flexible, more modular, and more concise than the original +JSON template format. While the JSON format is still supported, certain +new features in the Packer core will only be implemented for the newer HCL +format. Please use the side bar to find documentation for the different +template formats. - "provisioners": [ - { - "type": "shell", - "script": "setup_things.sh" - } - ] -} -``` +If you need help upgrading a JSON template to an HCL template, check +our upgrade guide [here](/guides/hcl/from-json-v1). diff --git a/website/content/docs/templates/builders.mdx b/website/content/docs/templates/legacy_json_templates/builders.mdx similarity index 100% rename from website/content/docs/templates/builders.mdx rename to website/content/docs/templates/legacy_json_templates/builders.mdx diff --git a/website/content/docs/templates/communicator.mdx b/website/content/docs/templates/legacy_json_templates/communicator.mdx similarity index 100% rename from website/content/docs/templates/communicator.mdx rename to website/content/docs/templates/legacy_json_templates/communicator.mdx diff --git a/website/content/docs/templates/engine.mdx b/website/content/docs/templates/legacy_json_templates/engine.mdx similarity index 100% rename from website/content/docs/templates/engine.mdx rename to website/content/docs/templates/legacy_json_templates/engine.mdx diff --git a/website/content/docs/templates/legacy_json_templates/index.mdx b/website/content/docs/templates/legacy_json_templates/index.mdx new file mode 100644 index 000000000..cdd54bf84 --- /dev/null +++ b/website/content/docs/templates/legacy_json_templates/index.mdx @@ -0,0 +1,114 @@ +--- +description: > + The JSON templates are JSON files that configure the various components + of Packer in order to create one or more machine images. Templates are + portable, static, and readable and writable by both humans and computers. + This has the added benefit of being able to not only create and modify + templates by hand, but also write scripts to dynamically create or modify + templates. +page_title: JSON Templates +sidebar_title: JSON Templates +--- + +# JSON Templates + +These Packer templates are JSON files that configure the various components +of Packer in order to create one or more machine images. Templates are portable, +static, and readable and writable by both humans and computers. + +Templates are given to commands such as `packer build`, which will take the +template and actually run the builds within it, producing any resulting machine +images. + +## JSON Template Structure + +The template is a JSON object that has a set of keys configuring various +components of Packer. The available keys within a template are listed below. +Along with each key, it is noted whether it is required or not. + +- `builders` (_required_) is an array of one or more objects that defines the + builders that will be used to create machine images for this template, and + configures each of those builders. For more information on how to define + and configure a builder, read the sub-section on [configuring builders in + templates](/docs/templates/builders). + +- `description` (optional) is a string providing a description of what the + template does. This output is used only in the [inspect + command](/docs/commands/inspect). + +- `min_packer_version` (optional) is a string that has a minimum Packer + version that is required to parse the template. This can be used to ensure + that proper versions of Packer are used with the template. A max version + can't be specified because Packer retains backwards compatibility with + `packer fix`. + +- `post-processors` (optional) is an array of one or more objects that + defines the various post-processing steps to take with the built images. If + not specified, then no post-processing will be done. For more information + on what post-processors do and how they're defined, read the sub-section on + [configuring post-processors in + templates](/docs/templates/post-processors). + +- `provisioners` (optional) is an array of one or more objects that defines + the provisioners that will be used to install and configure software for + the machines created by each of the builders. If it is not specified, then + no provisioners will be run. For more information on how to define and + configure a provisioner, read the sub-section on [configuring provisioners + in templates](/docs/templates/provisioners). + +- `variables` (optional) is an object of one or more key/value strings that + defines user variables contained in the template. If it is not specified, + then no variables are defined. For more information on how to define and + use user variables, read the sub-section on [user variables in + templates](/docs/templates/user-variables). + +## Comments + +JSON doesn't support comments and Packer reports unknown keys as validation +errors. If you'd like to comment your template, you can prefix a _root level_ +key with an underscore. Example: + +```json +{ + "_comment": "This is a comment", + "builders": [{}] +} +``` + +**Important:** Only _root level_ keys can be underscore prefixed. Keys within +builders, provisioners, etc. will still result in validation errors. + +## Example Template + +Below is an example of a basic template that could be invoked with +`packer build`. It would create an instance in AWS, and once running copy a +script to it and run that script using SSH. + +-> **Note:** This example requires an account with Amazon Web Services. +There are a number of parameters which need to be provided for a functional +build to take place. See the [Amazon builder](/docs/builders/amazon) +documentation for more information. + +```json +{ + "builders": [ + { + "type": "amazon-ebs", + "access_key": "...", + "secret_key": "...", + "region": "us-east-1", + "source_ami": "ami-fce3c696", + "instance_type": "t2.micro", + "ssh_username": "ubuntu", + "ami_name": "packer {{timestamp}}" + } + ], + + "provisioners": [ + { + "type": "shell", + "script": "setup_things.sh" + } + ] +} +``` diff --git a/website/content/docs/templates/post-processors.mdx b/website/content/docs/templates/legacy_json_templates/post-processors.mdx similarity index 100% rename from website/content/docs/templates/post-processors.mdx rename to website/content/docs/templates/legacy_json_templates/post-processors.mdx diff --git a/website/content/docs/templates/provisioners.mdx b/website/content/docs/templates/legacy_json_templates/provisioners.mdx similarity index 100% rename from website/content/docs/templates/provisioners.mdx rename to website/content/docs/templates/legacy_json_templates/provisioners.mdx diff --git a/website/content/docs/templates/user-variables.mdx b/website/content/docs/templates/legacy_json_templates/user-variables.mdx similarity index 100% rename from website/content/docs/templates/user-variables.mdx rename to website/content/docs/templates/legacy_json_templates/user-variables.mdx diff --git a/website/content/guides/packer-on-cicd/pipelineing-builds.mdx b/website/content/guides/packer-on-cicd/pipelineing-builds.mdx index 308b5b112..77651cd02 100644 --- a/website/content/guides/packer-on-cicd/pipelineing-builds.mdx +++ b/website/content/guides/packer-on-cicd/pipelineing-builds.mdx @@ -128,7 +128,7 @@ To run the build, call `packer build example_virtualbox_iso.json`. This example does not set the output_directory or output_filename, so the file will be placed in a default name of "output-virtualbox-iso/vbox-example.ovf" -- the builder will print this file name to the UI output, but in this example the -[manifest](https://www.packer.io/docs/post-processors/manifest) post-processor +[manifest](/docs/post-processors/manifest) post-processor to will store build information, including the names of the output files, in a json file named "stage-1-manifest.json". From there, you can programmatically look up the output file information. @@ -136,7 +136,7 @@ look up the output file information. ## Customizing the iso using the virtualbox-ovf builder That output filename generated in the first stage can be used as the -[source_path](https://www.packer.io/docs/builders/virtualbox/ovf#source_path) +[source_path](/docs/builders/virtualbox/ovf#source_path) for the virtualbox-ovf builder. diff --git a/website/content/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx b/website/content/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx index ae957a5e8..ea27adc86 100644 --- a/website/content/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx +++ b/website/content/partials/builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx @@ -55,5 +55,5 @@ - `tag` ([]{key string, value string}) - 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. diff --git a/website/content/partials/builder/amazon/chroot/Config-not-required.mdx b/website/content/partials/builder/amazon/chroot/Config-not-required.mdx index 7d5084e58..d70756fe1 100644 --- a/website/content/partials/builder/amazon/chroot/Config-not-required.mdx +++ b/website/content/partials/builder/amazon/chroot/Config-not-required.mdx @@ -127,7 +127,7 @@ - `root_volume_tag` ([]{key string, value string}) - 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. - `root_volume_encrypt_boot` (boolean) - Whether or not to encrypt the volumes that are *launched*. By default, Packer will keep diff --git a/website/content/partials/builder/amazon/common/AMIConfig-not-required.mdx b/website/content/partials/builder/amazon/common/AMIConfig-not-required.mdx index 06ed86b6c..b8498cd54 100644 --- a/website/content/partials/builder/amazon/common/AMIConfig-not-required.mdx +++ b/website/content/partials/builder/amazon/common/AMIConfig-not-required.mdx @@ -34,7 +34,7 @@ - `tag` ([]{key string, value string}) - 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. - `ena_support` (boolean) - Enable enhanced networking (ENA but not SriovNetSupport) on @@ -124,7 +124,7 @@ - `snapshot_tag` ([]{key string, value string}) - 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. - `snapshot_users` ([]string) - A list of account IDs that have diff --git a/website/content/partials/builder/amazon/common/RunConfig-not-required.mdx b/website/content/partials/builder/amazon/common/RunConfig-not-required.mdx index 72d468546..aa43bdca5 100644 --- a/website/content/partials/builder/amazon/common/RunConfig-not-required.mdx +++ b/website/content/partials/builder/amazon/common/RunConfig-not-required.mdx @@ -130,7 +130,7 @@ - `run_tag` ([]{key string, value string}) - 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. - `security_group_id` (string) - The ID (not the name) of the security @@ -234,7 +234,7 @@ - `spot_tag` ([]{key string, value string}) - 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. - `subnet_filter` (SubnetFilterOptions) - Filters used to populate the `subnet_id` field. diff --git a/website/content/partials/builder/amazon/ebs/Config-not-required.mdx b/website/content/partials/builder/amazon/ebs/Config-not-required.mdx index 2a152c906..e791ca10f 100644 --- a/website/content/partials/builder/amazon/ebs/Config-not-required.mdx +++ b/website/content/partials/builder/amazon/ebs/Config-not-required.mdx @@ -24,7 +24,7 @@ - `run_volume_tag` ([]{name string, value string}) - 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. - `no_ephemeral` (bool) - Relevant only to Windows guests: If you set this flag, we'll add clauses diff --git a/website/content/partials/builder/amazon/ebssurrogate/Config-not-required.mdx b/website/content/partials/builder/amazon/ebssurrogate/Config-not-required.mdx index 71951af3d..c90aadfa4 100644 --- a/website/content/partials/builder/amazon/ebssurrogate/Config-not-required.mdx +++ b/website/content/partials/builder/amazon/ebssurrogate/Config-not-required.mdx @@ -24,7 +24,7 @@ - `run_volume_tag` ([]{name string, value string}) - 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. - `ami_architecture` (string) - what architecture to use when registering the diff --git a/website/content/partials/builder/amazon/ebsvolume/BlockDevice-not-required.mdx b/website/content/partials/builder/amazon/ebsvolume/BlockDevice-not-required.mdx index f34134d5b..d3ba79efc 100644 --- a/website/content/partials/builder/amazon/ebsvolume/BlockDevice-not-required.mdx +++ b/website/content/partials/builder/amazon/ebsvolume/BlockDevice-not-required.mdx @@ -6,5 +6,5 @@ - `tag` ([]{key string, value string}) - 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. diff --git a/website/content/partials/builder/amazon/ebsvolume/Config-not-required.mdx b/website/content/partials/builder/amazon/ebsvolume/Config-not-required.mdx index ef4f375a7..b1da376a5 100644 --- a/website/content/partials/builder/amazon/ebsvolume/Config-not-required.mdx +++ b/website/content/partials/builder/amazon/ebsvolume/Config-not-required.mdx @@ -39,5 +39,5 @@ - `run_volume_tag` ([]{key string, value string}) - 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. diff --git a/website/content/partials/builder/azure/arm/Config-not-required.mdx b/website/content/partials/builder/azure/arm/Config-not-required.mdx index f1bfc1ec9..e3c969fe5 100644 --- a/website/content/partials/builder/azure/arm/Config-not-required.mdx +++ b/website/content/partials/builder/azure/arm/Config-not-required.mdx @@ -144,7 +144,7 @@ - `azure_tag` ([]{name string, value string}) - 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. - `resource_group_name` (string) - Resource group under which the final artifact will be stored. diff --git a/website/content/partials/builder/hyperone/Config-not-required.mdx b/website/content/partials/builder/hyperone/Config-not-required.mdx index 862552a19..b8b3fbb94 100644 --- a/website/content/partials/builder/hyperone/Config-not-required.mdx +++ b/website/content/partials/builder/hyperone/Config-not-required.mdx @@ -19,7 +19,7 @@ - `image_tag` ([]{key string, value string}) - 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. - `image_service` (string) - The service of the resulting image. @@ -30,7 +30,7 @@ - `vm_tag` ([]{name string, value string}) - 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. - `disk_name` (string) - The name of the created disk. diff --git a/website/content/partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx b/website/content/partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx index 1dbdc9bc6..ad800443d 100644 --- a/website/content/partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx +++ b/website/content/partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx @@ -65,7 +65,7 @@ - `run_tag` ([]{key string, value string}) - 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. - `ssh_private_ip` (bool) - SSH Private Ip diff --git a/website/content/partials/builder/triton/SourceMachineConfig-not-required.mdx b/website/content/partials/builder/triton/SourceMachineConfig-not-required.mdx index 725b952e5..b9b1488b5 100644 --- a/website/content/partials/builder/triton/SourceMachineConfig-not-required.mdx +++ b/website/content/partials/builder/triton/SourceMachineConfig-not-required.mdx @@ -27,7 +27,7 @@ - `source_machine_tag` ([]{key string, value string}) - 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. - `source_machine_firewall_enabled` (bool) - Whether or not the firewall diff --git a/website/content/partials/builder/triton/TargetImageConfig-not-required.mdx b/website/content/partials/builder/triton/TargetImageConfig-not-required.mdx index b42b2fdfe..52ccab6d0 100644 --- a/website/content/partials/builder/triton/TargetImageConfig-not-required.mdx +++ b/website/content/partials/builder/triton/TargetImageConfig-not-required.mdx @@ -17,5 +17,5 @@ - `image_tag` ([]{name string, value string}) - 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. diff --git a/website/content/partials/from-1.5/variables/custom-validation.mdx b/website/content/partials/from-1.5/variables/custom-validation.mdx index 8a6ef4a09..042aec146 100644 --- a/website/content/partials/from-1.5/variables/custom-validation.mdx +++ b/website/content/partials/from-1.5/variables/custom-validation.mdx @@ -22,7 +22,7 @@ The expression can refer only to the variable that the condition applies to, and _must not_ produce errors. If the failure of an expression is the basis of the validation decision, use -[the `can` function](/docs/from-1.5/functions/conversion/can) to detect such errors. For example: +[the `can` function](/docs/templates/hcl_templates/functions/conversion/can) to detect such errors. For example: ```hcl variable "image_id" { diff --git a/website/data/docs-navigation.js b/website/data/docs-navigation.js index bfc385afe..7e9b6019a 100644 --- a/website/data/docs-navigation.js +++ b/website/data/docs-navigation.js @@ -6,181 +6,186 @@ // the landing page for the category export default [ + '--------', + 'terminology', + { + category: 'commands', + content: ['build', 'console', 'fix', 'fmt', 'inspect', 'validate', 'hcl2_upgrade'], + }, { - category: 'from-1.5', + category: 'templates', content: [ - { - category: 'blocks', + { + category: "legacy_json_templates", + content: [ + 'builders', + 'communicator', + 'engine', + 'post-processors', + 'provisioners', + 'user-variables', + ] + }, + { + category: 'hcl_templates', content: [ { - category: 'build', + category: 'blocks', content: [ + { + category: 'build', + content: [ + 'source', + 'provisioner', + 'post-processor', + 'post-processors', + ], + }, + 'locals', 'source', - 'provisioner', - 'post-processor', - 'post-processors', - ], - }, - 'locals', - 'source', - 'variable', - 'packer', - ], - }, - { - category: 'functions', - content: [ - { - category: 'contextual', - content: [ - 'aws_secretsmanager', - 'consul', - 'env', - 'vault', - ], - }, - { - category: 'numeric', - content: [ - 'abs', - 'ceil', - 'floor', - 'log', - 'max', - 'min', - 'parseint', - 'pow', - 'signum', - ], - }, - { - category: 'string', - content: [ - 'chomp', - 'format', - 'formatlist', - 'indent', - 'join', - 'lower', - 'replace', - 'regex_replace', - 'split', - 'strrev', - 'substr', - 'title', - 'trim', - 'trimprefix', - 'trimsuffix', - 'trimspace', - 'upper', - ], - }, - { - category: 'collection', - content: [ - 'chunklist', - 'coalesce', - 'coalescelist', - 'compact', - 'concat', - 'contains', - 'distinct', - 'element', - 'flatten', - 'keys', - 'length', - 'lookup', - 'merge', - 'range', - 'reverse', - 'setintersection', - 'setproduct', - 'setunion', - 'slice', - 'sort', - 'values', - 'zipmap', + 'variable', + 'packer', ], }, { - category: 'encoding', + category: 'functions', content: [ - 'base64decode', - 'base64encode', - 'csvdecode', - 'jsondecode', - 'jsonencode', - 'urlencode', - 'yamldecode', - 'yamlencode', + { + category: 'contextual', + content: [ + 'aws_secretsmanager', + 'consul', + 'env', + 'vault', + ], + }, + { + category: 'numeric', + content: [ + 'abs', + 'ceil', + 'floor', + 'log', + 'max', + 'min', + 'parseint', + 'pow', + 'signum', + ], + }, + { + category: 'string', + content: [ + 'chomp', + 'format', + 'formatlist', + 'indent', + 'join', + 'lower', + 'replace', + 'regex_replace', + 'split', + 'strrev', + 'substr', + 'title', + 'trim', + 'trimprefix', + 'trimsuffix', + 'trimspace', + 'upper', + ], + }, + { + category: 'collection', + content: [ + 'chunklist', + 'coalesce', + 'coalescelist', + 'compact', + 'concat', + 'contains', + 'distinct', + 'element', + 'flatten', + 'keys', + 'length', + 'lookup', + 'merge', + 'range', + 'reverse', + 'setintersection', + 'setproduct', + 'setunion', + 'slice', + 'sort', + 'values', + 'zipmap', + ], + }, + { + category: 'encoding', + content: [ + 'base64decode', + 'base64encode', + 'csvdecode', + 'jsondecode', + 'jsonencode', + 'urlencode', + 'yamldecode', + 'yamlencode', + ], + }, + { + category: 'file', + content: [ + 'abspath', + 'basename', + 'dirname', + 'file', + 'fileexists', + 'fileset', + 'pathexpand', + ], + }, + { + category: 'datetime', + content: ['formatdate', 'timeadd', 'timestamp'], + }, + { + category: 'crypto', + content: [ + 'bcrypt', + 'md5', + 'rsadecrypt', + 'sha1', + 'sha256', + 'sha512', + ], + }, + { + category: 'uuid', + content: ['uuidv4', 'uuidv5'], + }, + { + category: 'ipnet', + content: ['cidrhost', 'cidrnetmask', 'cidrsubnet'], + }, + { + category: 'conversion', + content: ['can', 'convert', 'try'], + }, ], }, - { - category: 'file', - content: [ - 'abspath', - 'basename', - 'dirname', - 'file', - 'fileexists', - 'fileset', - 'pathexpand', - ], - }, - { - category: 'datetime', - content: ['formatdate', 'timeadd', 'timestamp'], - }, - { - category: 'crypto', - content: [ - 'bcrypt', - 'md5', - 'rsadecrypt', - 'sha1', - 'sha256', - 'sha512', - ], - }, - { - category: 'uuid', - content: ['uuidv4', 'uuidv5'], - }, - { - category: 'ipnet', - content: ['cidrhost', 'cidrnetmask', 'cidrsubnet'], - }, - { - category: 'conversion', - content: ['can', 'convert', 'try'], - }, + 'variables', + 'locals', + 'contextual-variables', + 'path-variables', + 'syntax', + 'onlyexcept', + 'expressions', + 'syntax-json', ], }, - 'variables', - 'locals', - 'contextual-variables', - 'path-variables', - 'syntax', - 'onlyexcept', - 'expressions', - 'syntax-json', - ], - }, - '--------', - 'terminology', - { - category: 'commands', - content: ['build', 'console', 'fix', 'fmt', 'inspect', 'validate', 'hcl2_upgrade'], - }, - { - category: 'templates', - content: [ - 'builders', - 'communicator', - 'engine', - 'post-processors', - 'provisioners', - 'user-variables', ], }, '----------', diff --git a/website/redirects.next.js b/website/redirects.next.js index ff904bea2..2200afa65 100644 --- a/website/redirects.next.js +++ b/website/redirects.next.js @@ -137,13 +137,23 @@ module.exports = [ permanent: true, }, { - source: '/docs/configuration/from-1.5/:path*', - destination: '/docs/from-1.5/:path*', + source: '/docs/configuration/from-1.5/:path*/overview', + destination: '/docs/templates/hcl_templates/:path*', permanent: true, }, { - source: '/docs/configuration/from-1.5/:path*/overview', - destination: '/docs/from-1.5/:path*', + source: '/docs/from-1.5/:path*', + destination: '/docs/templates/hcl_templates/:path*', + permanent: true, + }, + { + source: '/docs/templates/hcl_templates/:path*', + destination: '/docs/templates/hcl_templates/:path*', + permanent: true, + }, + { + source: '/docs/templates/hcl_templates/:path*/overview', + destination: '/docs/templates/hcl_templates/:path*', permanent: true, }, {