From 0306759840ada97486587bd01c0106c4480f2875 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 22 Aug 2013 15:11:54 -0700 Subject: [PATCH] builder/amazon: support tags in chroot and instance --- CHANGELOG.md | 4 ++++ builder/amazon/chroot/builder.go | 7 +++++++ builder/amazon/instance/builder.go | 7 ++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ee798d3..2812ad734 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ FEATURES: * builder/vmware: The root hard drive type can now be specified with "disk_type_id" for advanced users. [GH-328] +IMPROVEMENTS: + +* builder/amazon: Tagging now works with all amazon builder types. + BUG FIXES: * core: Fixed a couple cases where a double ctrl-C could panic. diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index 9996c4478..d8589a30b 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -189,6 +189,13 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe &StepEarlyCleanup{}, &StepSnapshot{}, &StepRegisterAMI{}, + &awscommon.StepAMIRegionCopy{ + Regions: b.config.AMIRegions, + Tags: b.config.AMITags, + }, + &awscommon.StepCreateTags{ + Tags: b.config.AMITags, + }, &awscommon.StepModifyAMIAttributes{ Description: b.config.AMIDescription, Users: b.config.AMIUsers, diff --git a/builder/amazon/instance/builder.go b/builder/amazon/instance/builder.go index 5c3079557..53f73dc80 100644 --- a/builder/amazon/instance/builder.go +++ b/builder/amazon/instance/builder.go @@ -33,7 +33,6 @@ type Config struct { BundleUploadCommand string `mapstructure:"bundle_upload_command"` BundleVolCommand string `mapstructure:"bundle_vol_command"` S3Bucket string `mapstructure:"s3_bucket"` - Tags map[string]string X509CertPath string `mapstructure:"x509_cert_path"` X509KeyPath string `mapstructure:"x509_key_path"` X509UploadPath string `mapstructure:"x509_upload_path"` @@ -213,9 +212,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe &StepRegisterAMI{}, &awscommon.StepAMIRegionCopy{ Regions: b.config.AMIRegions, - Tags: b.config.Tags, + Tags: b.config.AMITags, + }, + &awscommon.StepCreateTags{ + Tags: b.config.AMITags, }, - &awscommon.StepCreateTags{Tags: b.config.Tags}, &awscommon.StepModifyAMIAttributes{ Description: b.config.AMIDescription, Users: b.config.AMIUsers,