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))