diff --git a/builder/alicloud/ecs/image_config.go b/builder/alicloud/ecs/image_config.go index a7e5f008c..5f6218abd 100644 --- a/builder/alicloud/ecs/image_config.go +++ b/builder/alicloud/ecs/image_config.go @@ -7,6 +7,7 @@ import ( "regexp" "strings" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/template/interpolate" ) @@ -189,14 +190,19 @@ type AlicloudImageConfig struct { // The region validation can be skipped // if this value is true, the default value is false. AlicloudImageSkipRegionValidation bool `mapstructure:"skip_region_validation" required:"false"` - // Tags applied to the destination - // image and relevant snapshots. - AlicloudImageTags map[string]string `mapstructure:"tags" required:"false"` + // Tags applied to the destination image and relevant snapshots. + AlicloudImageTags map[string]string `mapstructure:"tags" required:"false"` + // Same as [`tags`](#tags) but defined as a singular block containing a key + // and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + AlicloudImageTag hcl2template.KeyValues `mapstructure:"tag" required:"false"` AlicloudDiskDevices `mapstructure:",squash"` } func (c *AlicloudImageConfig) Prepare(ctx *interpolate.Context) []error { var errs []error + errs = append(errs, c.AlicloudImageTag.CopyOn(c.AlicloudImageTags)...) if c.AlicloudImageName == "" { errs = append(errs, fmt.Errorf("image_name must be specified")) } else if len(c.AlicloudImageName) < 2 || len(c.AlicloudImageName) > 128 { diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index 18801841f..96283eb57 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -18,6 +18,7 @@ import ( awscommon "github.com/hashicorp/packer/builder/amazon/common" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/common/chroot" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" @@ -163,6 +164,11 @@ type Config struct { // engine](/docs/templates/engine.html), see [Build template // data](#build-template-data) for more information. RootVolumeTags awscommon.TagMap `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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + RootVolumeTag hcl2template.KeyValues `mapstructure:"root_volume_tag" required:"false"` // what architecture to use when registering the final AMI; valid options // are "x86_64" or "arm64". Defaults to "x86_64". Architecture string `mapstructure:"ami_architecture" required:"false"` @@ -253,10 +259,12 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { var errs *packer.MultiError var warns []string - for _, preparer := range []interface{ Prepare() error }{ + errs = packer.MultiErrorAppend(errs, b.RootVolumeTag.CopyOn(b.RootVolumeTags)...) + + for _, preparer := range []interface{ Prepare() []error }{ &b.config.SourceAmiFilter, } { - errs = packer.MultiErrorAppend(errs, preparer.Prepare()) + errs = packer.MultiErrorAppend(errs, preparer.Prepare()...) } errs = packer.MultiErrorAppend(errs, b.config.AccessConfig.Prepare(&b.config.ctx)...) diff --git a/builder/amazon/common/ami_config.go b/builder/amazon/common/ami_config.go index 8a5b83a67..533264463 100644 --- a/builder/amazon/common/ami_config.go +++ b/builder/amazon/common/ami_config.go @@ -7,6 +7,7 @@ import ( "log" "regexp" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/template/interpolate" ) @@ -50,6 +51,11 @@ type AMIConfig struct { // [template engine](/docs/templates/engine.html), see [Build template // data](#build-template-data) for more information. AMITags TagMap `mapstructure:"tags" required:"false"` + // Same as [`tags`](#tags) but defined as a singular block containing a key + // and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + AMITag hcl2template.KeyValues `mapstructure:"tag" required:"false"` // Enable enhanced networking (ENA but not SriovNetSupport) on // HVM-compatible AMIs. If set, add `ec2:ModifyInstanceAttribute` to your // AWS IAM policy. @@ -116,6 +122,11 @@ type AMIConfig struct { // [template engine](../templates/engine.html), see [Build template // data](#build-template-data) for more information. SnapshotTags TagMap `mapstructure:"snapshot_tags" required:"false"` + // Same as [`snapshot_tags`](#snapshot_tags) but defined as a singular + // block containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + SnapshotTag []hcl2template.KeyValues `mapstructure:"snapshot_tag" required:"false"` // A list of account IDs that have // access to create volumes from the snapshot(s). By default no additional // users other than the user creating the AMI has permissions to create diff --git a/builder/amazon/common/run_config.go b/builder/amazon/common/run_config.go index 9cd8d1a45..dc6e8b6e7 100644 --- a/builder/amazon/common/run_config.go +++ b/builder/amazon/common/run_config.go @@ -187,6 +187,11 @@ type RunConfig struct { // EBS volumes. This is a [template engine](/docs/templates/engine.html), // see [Build template data](#build-template-data) for more information. RunTags map[string]string `mapstructure:"run_tags" required:"false"` + // Same as [`run_tags`](#run_tags) but defined as a singular block + // containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + RunTag []hcl2template.KeyValues `mapstructure:"run_tag" required:"false"` // The ID (not the name) of the security // group to assign to the instance. By default this is not set and Packer will // automatically create a new temporary security group to allow SSH access. @@ -276,9 +281,14 @@ type RunConfig struct { // Windows, Linux/UNIX (Amazon VPC), SUSE Linux (Amazon VPC), // Windows (Amazon VPC) SpotPriceAutoProduct string `mapstructure:"spot_price_auto_product" required:"false"` - // Requires spot_price to be - // set. This tells Packer to apply tags to the spot request that is issued. + // Requires spot_price to be set. This tells Packer to apply tags to the + // spot request that is issued. SpotTags map[string]string `mapstructure:"spot_tags" required:"false"` + // Same as [`spot_tags`](#spot_tags) but defined as a singular block + // containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + SpotTag hcl2template.KeyValues `mapstructure:"spot_tag" required:"false"` // Filters used to populate the `subnet_id` field. // Example: // @@ -412,15 +422,13 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error { // Validation errs := c.Comm.Prepare(ctx) - for _, preparer := range []interface{ Prepare() error }{ + for _, preparer := range []interface{ Prepare() []error }{ &c.SourceAmiFilter, &c.SecurityGroupFilter, &c.SubnetFilter, &c.VpcFilter, } { - if err := preparer.Prepare(); err != nil { - errs = append(errs, err) - } + errs = append(errs, preparer.Prepare()...) } // Validating ssh_interface diff --git a/builder/amazon/ebsvolume/block_device.go b/builder/amazon/ebsvolume/block_device.go index 37c0dd28d..c0253c227 100644 --- a/builder/amazon/ebsvolume/block_device.go +++ b/builder/amazon/ebsvolume/block_device.go @@ -5,6 +5,7 @@ package ebsvolume import ( "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/template/interpolate" ) @@ -14,6 +15,11 @@ type BlockDevice struct { // completes. This is a [template engine](/docs/templates/engine.html), see // [Build template data](#build-template-data) for more information. Tags awscommon.TagMap `mapstructure:"tags" required:"false"` + // Same as [`tags`](#tags) but defined as a singular block + // containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + Tag hcl2template.KeyValues `mapstructure:"tag" required:"false"` } type BlockDevices []BlockDevice diff --git a/builder/azure/arm/config.go b/builder/azure/arm/config.go index ba7a26f5d..3e2fbb659 100644 --- a/builder/azure/arm/config.go +++ b/builder/azure/arm/config.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/packer/builder/azure/common/constants" "github.com/hashicorp/packer/builder/azure/pkcs12" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/packer" @@ -240,6 +241,11 @@ type Config struct { // 256 characters. Tags are applied to every resource deployed by a Packer // build, i.e. Resource Group, VM, NIC, VNET, Public IP, KeyVault, etc. AzureTags map[string]*string `mapstructure:"azure_tags" required:"false"` + // Same as [`azure_tags`](#azure_tags) but defined as a singular block + // containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + AzureTag []hcl2template.KeyValues `mapstructure:"azure_tag" required:"false"` // Resource group under which the final artifact will be stored. ResourceGroupName string `mapstructure:"resource_group_name"` // Storage account under which the final artifact will be stored. diff --git a/builder/hyperone/config.go b/builder/hyperone/config.go index 9c6a4144f..413f77d92 100644 --- a/builder/hyperone/config.go +++ b/builder/hyperone/config.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/common/json" "github.com/hashicorp/packer/common/uuid" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/helper/multistep" @@ -60,9 +61,13 @@ type Config struct { ImageName string `mapstructure:"image_name" required:"false"` // The description of the resulting image. ImageDescription string `mapstructure:"image_description" required:"false"` - // Key/value pair tags to - // add to the created image. + // Key/value pair tags to add to the created image. ImageTags map[string]string `mapstructure:"image_tags" required:"false"` + // Same as [`image_tags`](#image_tags) but defined as a singular block + // containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + ImageTag []hcl2template.KeyValues `mapstructure:"image_tag" required:"false"` // The service of the resulting image. ImageService string `mapstructure:"image_service" required:"false"` // ID or name of the type this server should be created with. @@ -72,6 +77,11 @@ type Config struct { // Key/value pair tags to // add to the created server. VmTags map[string]string `mapstructure:"vm_tags" required:"false"` + // Same as [`vm_tags`](#vm_tags) but defined as a singular block containing + // a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + VmTag []hcl2template.KeyValues `mapstructure:"vm_tag" required:"false"` // The name of the created disk. DiskName string `mapstructure:"disk_name" required:"false"` // The type of the created disk. Defaults to ssd. diff --git a/builder/osc/common/run_config.go b/builder/osc/common/run_config.go index 4ac450fce..112bcd069 100644 --- a/builder/osc/common/run_config.go +++ b/builder/osc/common/run_config.go @@ -104,15 +104,13 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error { // Validation errs := c.Comm.Prepare(ctx) - for _, preparer := range []interface{ Prepare() error }{ + for _, preparer := range []interface{ Prepare() []error }{ &c.SourceOmiFilter, &c.SecurityGroupFilter, &c.SubnetFilter, &c.NetFilter, } { - if err := preparer.Prepare(); err != nil { - errs = append(errs, err) - } + errs = append(errs, preparer.Prepare()...) } // Validating ssh_interface diff --git a/builder/tencentcloud/cvm/run_config.go b/builder/tencentcloud/cvm/run_config.go index 719d7caa3..315ddcec8 100644 --- a/builder/tencentcloud/cvm/run_config.go +++ b/builder/tencentcloud/cvm/run_config.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/hashicorp/packer/common/uuid" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/template/interpolate" "github.com/pkg/errors" @@ -83,6 +84,11 @@ type TencentCloudRunConfig struct { // Tags to apply to the instance that is *launched* to create the image. // These tags are *not* applied to the resulting image. RunTags map[string]string `mapstructure:"run_tags" required:"false"` + // Same as [`run_tags`](#run_tags) but defined as a singular block + // containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + RunTag []hcl2template.KeyValues `mapstructure:"run_tag" required:"false"` // Communicator settings Comm communicator.Config `mapstructure:",squash"` diff --git a/builder/triton/source_machine_config.go b/builder/triton/source_machine_config.go index 906b5c38f..385690c53 100644 --- a/builder/triton/source_machine_config.go +++ b/builder/triton/source_machine_config.go @@ -6,6 +6,7 @@ package triton import ( "fmt" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/template/interpolate" ) @@ -52,9 +53,13 @@ type SourceMachineConfig struct { // set the user-script metadata key to have Triton start a user supplied // script after the VM has booted. MachineMetadata map[string]string `mapstructure:"source_machine_metadata" required:"false"` - // Tags applied to the - // VM used to create the image. + // Tags applied to the VM used to create the image. 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + MachineTag []hcl2template.KeyValues `mapstructure:"source_machine_tag" required:"false"` // Whether or not the firewall // of the VM used to create an image of is enabled. The Triton firewall only // filters inbound traffic to the VM. All outbound traffic is always allowed. diff --git a/builder/triton/target_image_config.go b/builder/triton/target_image_config.go index a0a5c73ef..43dd6d34f 100644 --- a/builder/triton/target_image_config.go +++ b/builder/triton/target_image_config.go @@ -5,6 +5,7 @@ package triton import ( "fmt" + "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/template/interpolate" ) @@ -36,6 +37,11 @@ type TargetImageConfig struct { ImageACL []string `mapstructure:"image_acls" required:"false"` // Tag applied to the image. ImageTags map[string]string `mapstructure:"image_tags" required:"false"` + // Same as [`image_tags`](#image_tags) but defined as a singular block + // containing a key and a value field. In HCL2 mode the + // [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + // will allow you to create those programatically. + ImageTag []hcl2template.KeyValues `mapstructure:"image_tag" required:"false"` } // Prepare performs basic validation on a TargetImageConfig struct. diff --git a/hcl2template/types.kv.go b/hcl2template/types.kv.go index 49b7bb3b0..b9c40960d 100644 --- a/hcl2template/types.kv.go +++ b/hcl2template/types.kv.go @@ -1,4 +1,4 @@ -//go:generate mapstructure-to-hcl2 -type KeyValue +//go:generate mapstructure-to-hcl2 -type KeyValue,KeyValues,KVFilter package hcl2template @@ -7,15 +7,22 @@ type KeyValue struct { Value string } -type KVFilter struct { - Filters map[string]string - Filter []KeyValue +type KeyValues []KeyValue + +func (kvs KeyValues) CopyOn(to map[string]string) []error { + for _, kv := range kvs { + to[kv.Key] = kv.Value + } + return nil } -func (kvf *KVFilter) Prepare() error { - for _, filter := range kvf.Filter { - kvf.Filters[filter.Key] = filter.Value - } +type KVFilter struct { + Filters map[string]string + Filter KeyValues +} + +func (kvf *KVFilter) Prepare() []error { + kvf.Filter.CopyOn(kvf.Filters) return nil } diff --git a/website/source/partials/builder/alicloud/ecs/_AlicloudImageConfig-not-required.html.md b/website/source/partials/builder/alicloud/ecs/_AlicloudImageConfig-not-required.html.md index 1aaffe8f3..12ed98f1a 100644 --- a/website/source/partials/builder/alicloud/ecs/_AlicloudImageConfig-not-required.html.md +++ b/website/source/partials/builder/alicloud/ecs/_AlicloudImageConfig-not-required.html.md @@ -49,6 +49,10 @@ - `skip_region_validation` (bool) - The region validation can be skipped if this value is true, the default value is false. -- `tags` (map[string]string) - Tags applied to the destination - image and relevant snapshots. +- `tags` (map[string]string) - Tags applied to the destination image and relevant snapshots. + +- `tag` (hcl2template.KeyValues) - Same as [`tags`](#tags) but defined as a singular block containing a key + and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. \ No newline at end of file diff --git a/website/source/partials/builder/amazon/chroot/_Config-not-required.html.md b/website/source/partials/builder/amazon/chroot/_Config-not-required.html.md index 5272dc712..24ae95b31 100644 --- a/website/source/partials/builder/amazon/chroot/_Config-not-required.html.md +++ b/website/source/partials/builder/amazon/chroot/_Config-not-required.html.md @@ -125,6 +125,11 @@ engine](/docs/templates/engine.html), see [Build template data](#build-template-data) for more information. +- `root_volume_tag` (hcl2template.KeyValues) - 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. + - `ami_architecture` (string) - what architecture to use when registering the final AMI; valid options are "x86_64" or "arm64". Defaults to "x86_64". \ No newline at end of file diff --git a/website/source/partials/builder/amazon/common/_AMIConfig-not-required.html.md b/website/source/partials/builder/amazon/common/_AMIConfig-not-required.html.md index 6cd6c65ff..d74728fc5 100644 --- a/website/source/partials/builder/amazon/common/_AMIConfig-not-required.html.md +++ b/website/source/partials/builder/amazon/common/_AMIConfig-not-required.html.md @@ -32,6 +32,11 @@ [template engine](/docs/templates/engine.html), see [Build template data](#build-template-data) for more information. +- `tag` (hcl2template.KeyValues) - Same as [`tags`](#tags) but defined as a singular block containing a key + and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. + - `ena_support` (boolean) - Enable enhanced networking (ENA but not SriovNetSupport) on HVM-compatible AMIs. If set, add `ec2:ModifyInstanceAttribute` to your AWS IAM policy. @@ -98,6 +103,11 @@ [template engine](../templates/engine.html), see [Build template data](#build-template-data) for more information. +- `snapshot_tag` ([]hcl2template.KeyValues) - Same as [`snapshot_tags`](#snapshot_tags) but defined as a singular + block containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. + - `snapshot_users` ([]string) - A list of account IDs that have access to create volumes from the snapshot(s). By default no additional users other than the user creating the AMI has permissions to create diff --git a/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md b/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md index 9a62ee69c..97ec32dad 100644 --- a/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md +++ b/website/source/partials/builder/amazon/common/_RunConfig-not-required.html.md @@ -113,6 +113,11 @@ EBS volumes. This is a [template engine](/docs/templates/engine.html), see [Build template data](#build-template-data) for more information. +- `run_tag` ([]hcl2template.KeyValues) - Same as [`run_tags`](#run_tags) but defined as a singular block + containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. + - `security_group_id` (string) - The ID (not the name) of the security group to assign to the instance. By default this is not set and Packer will automatically create a new temporary security group to allow SSH access. @@ -197,8 +202,13 @@ Windows, Linux/UNIX (Amazon VPC), SUSE Linux (Amazon VPC), Windows (Amazon VPC) -- `spot_tags` (map[string]string) - Requires spot_price to be - set. This tells Packer to apply tags to the spot request that is issued. +- `spot_tags` (map[string]string) - Requires spot_price to be set. This tells Packer to apply tags to the + spot request that is issued. + +- `spot_tag` (hcl2template.KeyValues) - Same as [`spot_tags`](#spot_tags) but defined as a singular block + containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. - `subnet_filter` (SubnetFilterOptions) - Filters used to populate the `subnet_id` field. Example: diff --git a/website/source/partials/builder/amazon/ebsvolume/_BlockDevice-not-required.html.md b/website/source/partials/builder/amazon/ebsvolume/_BlockDevice-not-required.html.md index bd0fb9e1e..22d2c8ed9 100644 --- a/website/source/partials/builder/amazon/ebsvolume/_BlockDevice-not-required.html.md +++ b/website/source/partials/builder/amazon/ebsvolume/_BlockDevice-not-required.html.md @@ -3,4 +3,9 @@ - `tags` (awscommon.TagMap) - Tags to apply to the volume. These are retained after the builder completes. This is a [template engine](/docs/templates/engine.html), see [Build template data](#build-template-data) for more information. + +- `tag` (hcl2template.KeyValues) - Same as [`tags`](#tags) but defined as a singular block + containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. \ No newline at end of file diff --git a/website/source/partials/builder/azure/arm/_Config-not-required.html.md b/website/source/partials/builder/azure/arm/_Config-not-required.html.md index b6f549fc6..90b9ad930 100644 --- a/website/source/partials/builder/azure/arm/_Config-not-required.html.md +++ b/website/source/partials/builder/azure/arm/_Config-not-required.html.md @@ -100,6 +100,11 @@ 256 characters. Tags are applied to every resource deployed by a Packer build, i.e. Resource Group, VM, NIC, VNET, Public IP, KeyVault, etc. +- `azure_tag` ([]hcl2template.KeyValues) - Same as [`azure_tags`](#azure_tags) but defined as a singular block + containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. + - `resource_group_name` (string) - Resource group under which the final artifact will be stored. - `storage_account` (string) - Storage account under which the final artifact will be stored. diff --git a/website/source/partials/builder/hyperone/_Config-not-required.html.md b/website/source/partials/builder/hyperone/_Config-not-required.html.md index 89bb59ca7..ab8565c68 100644 --- a/website/source/partials/builder/hyperone/_Config-not-required.html.md +++ b/website/source/partials/builder/hyperone/_Config-not-required.html.md @@ -15,8 +15,12 @@ - `image_description` (string) - The description of the resulting image. -- `image_tags` (map[string]string) - Key/value pair tags to - add to the created image. +- `image_tags` (map[string]string) - Key/value pair tags to add to the created image. + +- `image_tag` ([]hcl2template.KeyValues) - Same as [`image_tags`](#image_tags) but defined as a singular block + containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. - `image_service` (string) - The service of the resulting image. @@ -25,6 +29,11 @@ - `vm_tags` (map[string]string) - Key/value pair tags to add to the created server. +- `vm_tag` ([]hcl2template.KeyValues) - Same as [`vm_tags`](#vm_tags) but defined as a singular block containing + a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. + - `disk_name` (string) - The name of the created disk. - `disk_type` (string) - The type of the created disk. Defaults to ssd. diff --git a/website/source/partials/builder/tencentcloud/cvm/_TencentCloudRunConfig-not-required.html.md b/website/source/partials/builder/tencentcloud/cvm/_TencentCloudRunConfig-not-required.html.md index 3a6953e58..762f9eaaa 100644 --- a/website/source/partials/builder/tencentcloud/cvm/_TencentCloudRunConfig-not-required.html.md +++ b/website/source/partials/builder/tencentcloud/cvm/_TencentCloudRunConfig-not-required.html.md @@ -55,4 +55,9 @@ - `run_tags` (map[string]string) - Tags to apply to the instance that is *launched* to create the image. These tags are *not* applied to the resulting image. +- `run_tag` ([]hcl2template.KeyValues) - Same as [`run_tags`](#run_tags) but defined as a singular block + containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. + - `ssh_private_ip` (bool) - SSH Private Ip \ No newline at end of file diff --git a/website/source/partials/builder/triton/_SourceMachineConfig-not-required.html.md b/website/source/partials/builder/triton/_SourceMachineConfig-not-required.html.md index a3e6d821e..ecf3a5be5 100644 --- a/website/source/partials/builder/triton/_SourceMachineConfig-not-required.html.md +++ b/website/source/partials/builder/triton/_SourceMachineConfig-not-required.html.md @@ -23,8 +23,12 @@ set the user-script metadata key to have Triton start a user supplied script after the VM has booted. -- `source_machine_tags` (map[string]string) - Tags applied to the - VM used to create the image. +- `source_machine_tags` (map[string]string) - Tags applied to the VM used to create the image. + +- `source_machine_tag` ([]hcl2template.KeyValues) - 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. - `source_machine_firewall_enabled` (bool) - Whether or not the firewall of the VM used to create an image of is enabled. The Triton firewall only diff --git a/website/source/partials/builder/triton/_TargetImageConfig-not-required.html.md b/website/source/partials/builder/triton/_TargetImageConfig-not-required.html.md index c66a0fef6..9b638736a 100644 --- a/website/source/partials/builder/triton/_TargetImageConfig-not-required.html.md +++ b/website/source/partials/builder/triton/_TargetImageConfig-not-required.html.md @@ -14,4 +14,9 @@ credentials are used) will have access to the image. - `image_tags` (map[string]string) - Tag applied to the image. + +- `image_tag` ([]hcl2template.KeyValues) - Same as [`image_tags`](#image_tags) but defined as a singular block + containing a key and a value field. In HCL2 mode the + [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks) + will allow you to create those programatically. \ No newline at end of file