WIP
This commit is contained in:
parent
dbb4981d66
commit
dab689ce2e
|
@ -192,7 +192,7 @@ type AlicloudImageConfig struct {
|
|||
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"`
|
||||
// Same as [`tags`](#tags) but defined as a singular block containing a key
|
||||
// Same as [`tags`](#tags) but defined as a singular repeatable 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.
|
||||
|
|
|
@ -51,7 +51,7 @@ 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
|
||||
// Same as [`tags`](#tags) but defined as a singular repeatable 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.
|
||||
|
|
|
@ -187,11 +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
|
||||
// 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`](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"`
|
||||
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.
|
||||
|
@ -284,7 +284,7 @@ type RunConfig struct {
|
|||
// 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
|
||||
// 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
|
@ -422,6 +422,16 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
|
|||
// Validation
|
||||
errs := c.Comm.Prepare(ctx)
|
||||
|
||||
for _, s := range []struct {
|
||||
tagMap TagMap
|
||||
kvs hcl2template.KeyValues
|
||||
}{
|
||||
{c.RunTags, c.RunTag},
|
||||
{c.SpotTags, c.SpotTag},
|
||||
} {
|
||||
errs = append(errs, s.kvs.CopyOn(s.tagMap)...)
|
||||
}
|
||||
|
||||
for _, preparer := range []interface{ Prepare() []error }{
|
||||
&c.SourceAmiFilter,
|
||||
&c.SecurityGroupFilter,
|
||||
|
|
|
@ -15,7 +15,7 @@ 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
|
||||
// Same as [`tags`](#tags) but defined as a singular repeatable 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.
|
||||
|
|
|
@ -241,7 +241,7 @@ 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
|
||||
// Same as [`azure_tags`](#azure_tags) but defined as a singular repeatable 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.
|
||||
|
|
|
@ -63,7 +63,7 @@ type Config struct {
|
|||
ImageDescription string `mapstructure:"image_description" required:"false"`
|
||||
// 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
|
||||
// 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
|
@ -77,7 +77,7 @@ 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
|
||||
// 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
|
|
|
@ -84,7 +84,7 @@ 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
|
||||
// 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
|
|
|
@ -37,7 +37,7 @@ 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
|
||||
// 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`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
|
||||
// will allow you to create those programatically.
|
||||
|
|
Loading…
Reference in New Issue