diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go index 5f3be3df9..e5743f202 100644 --- a/builder/amazon/common/step_security_group.go +++ b/builder/amazon/common/step_security_group.go @@ -27,6 +27,10 @@ func (s *StepSecurityGroup) Run(state map[string]interface{}) multistep.StepActi return multistep.ActionContinue } + if s.SSHPort == 0 { + panic("SSHPort must be set to a non-zero value.") + } + // Create the group ui.Say("Creating temporary security group for this instance...") groupName := fmt.Sprintf("packer %s", hex.EncodeToString(identifier.NewUUID().Raw()))