From fad363d9252acf35c53bfbd8c5586ae1afaead7e Mon Sep 17 00:00:00 2001 From: Jeremy Asher Date: Tue, 9 Aug 2016 16:55:10 -0700 Subject: [PATCH] ami_name is not required with skip_register_ami --- builder/amazon/common/ami_config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder/amazon/common/ami_config.go b/builder/amazon/common/ami_config.go index 2a32d262518..e34129751dc 100644 --- a/builder/amazon/common/ami_config.go +++ b/builder/amazon/common/ami_config.go @@ -25,10 +25,12 @@ type AMIConfig struct { func (c *AMIConfig) Prepare(ctx *interpolate.Context) []error { var errs []error - if c.AMIName == "" { + if c.AMIName == "" && !c.AMISkipRegister { errs = append(errs, fmt.Errorf("ami_name must be specified")) } + // TODO: confirm that bypassed options aren't supplied with skip_register_ami + if len(c.AMIRegions) > 0 { regionSet := make(map[string]struct{}) regions := make([]string, 0, len(c.AMIRegions))