|
|
|
|
@ -15,9 +15,10 @@ import (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type StepSecurityGroup struct {
|
|
|
|
|
CommConfig *communicator.Config
|
|
|
|
|
SecurityGroupIds []string
|
|
|
|
|
VpcId string
|
|
|
|
|
CommConfig *communicator.Config
|
|
|
|
|
SecurityGroupIds []string
|
|
|
|
|
VpcId string
|
|
|
|
|
SecurityGroupSourceCidr string
|
|
|
|
|
|
|
|
|
|
createdGroupId string
|
|
|
|
|
}
|
|
|
|
|
@ -78,15 +79,15 @@ func (s *StepSecurityGroup) Run(state multistep.StateBag) multistep.StepAction {
|
|
|
|
|
IpProtocol: aws.String("tcp"),
|
|
|
|
|
FromPort: aws.Int64(int64(port)),
|
|
|
|
|
ToPort: aws.Int64(int64(port)),
|
|
|
|
|
CidrIp: aws.String("0.0.0.0/0"),
|
|
|
|
|
CidrIp: aws.String(s.SecurityGroupSourceCidr),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// We loop and retry this a few times because sometimes the security
|
|
|
|
|
// group isn't available immediately because AWS resources are eventually
|
|
|
|
|
// consistent.
|
|
|
|
|
ui.Say(fmt.Sprintf(
|
|
|
|
|
"Authorizing access to port %d on the temporary security group...",
|
|
|
|
|
port))
|
|
|
|
|
"Authorizing access to port %d from %s in the temporary security group...",
|
|
|
|
|
port, s.SecurityGroupSourceCidr))
|
|
|
|
|
for i := 0; i < 5; i++ {
|
|
|
|
|
_, err = ec2conn.AuthorizeSecurityGroupIngress(req)
|
|
|
|
|
if err == nil {
|
|
|
|
|
|