Add option to enable tagging of the running instances volumes

* Currently this results in *all* volumes attached to the instance
  being tagged with the `run_volume_tags`. This includes any `ebs_volumes`
  for which the user may have configured other tags.
* This issue will be addressed in a later commit
This commit is contained in:
DanHam 2019-08-28 09:34:16 +01:00
parent 30070ffb30
commit 430d41fbf9
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 6 additions and 3 deletions

View File

@ -23,9 +23,10 @@ type Config struct {
awscommon.AccessConfig `mapstructure:",squash"`
awscommon.RunConfig `mapstructure:",squash"`
AMIENASupport *bool `mapstructure:"ena_support"`
AMISriovNetSupport bool `mapstructure:"sriov_support"`
VolumeMappings []BlockDevice `mapstructure:"ebs_volumes"`
AMIENASupport *bool `mapstructure:"ena_support"`
AMISriovNetSupport bool `mapstructure:"sriov_support"`
VolumeMappings []BlockDevice `mapstructure:"ebs_volumes"`
VolumeRunTags awscommon.TagMap `mapstructure:"run_volume_tags"`
launchBlockDevices awscommon.BlockDevices
ctx interpolate.Context
@ -135,6 +136,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
Tags: b.config.RunTags,
UserData: b.config.UserData,
UserDataFile: b.config.UserDataFile,
VolumeTags: b.config.VolumeRunTags,
}
} else {
instanceStep = &awscommon.StepRunSourceInstance{
@ -154,6 +156,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
Tags: b.config.RunTags,
UserData: b.config.UserData,
UserDataFile: b.config.UserDataFile,
VolumeTags: b.config.VolumeRunTags,
}
}