diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go index 38ee00804..1d95619fe 100644 --- a/builder/amazon/common/step_security_group.go +++ b/builder/amazon/common/step_security_group.go @@ -60,6 +60,9 @@ func (s *StepSecurityGroup) Run(state multistep.StateBag) multistep.StepAction { }, } + // We loop and retry this a few times because sometimes the security + // group isn't available immediately because AWS resources are eventaully + // consistent. ui.Say("Authorizing SSH access on the temporary security group...") for i := 0; i < 5; i++ { _, err = ec2conn.AuthorizeSecurityGroup(groupResp.SecurityGroup, perms)