From 579eaaabc5d794ebde8b1979c9de256ca089c277 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 20 Jul 2013 19:51:25 -0700 Subject: [PATCH] builder/amazon/common: panic if SSHPot is 0 --- builder/amazon/common/step_security_group.go | 4 ++++ 1 file changed, 4 insertions(+) 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()))