Honor ssh_private_ip flag in EC2-Classic, not just VPC

VpcId will be nil in Classic, but we may still wish to ssh to the
instance's private IP address -- if for example we are using security
groups to block SSH access via the public IP.
pull/3752/head
Robert Tarrall 10 years ago
parent f9cea9edd1
commit 94bf981d3b

@ -23,6 +23,8 @@ func SSHHost(e *ec2.EC2, private bool) func(multistep.StateBag) (string, error)
} else {
host = *i.PrivateIpAddress
}
} else if private {
host = *i.PrivateIpAddress
} else if i.PublicDnsName != nil && *i.PublicDnsName != "" {
host = *i.PublicDnsName
}

Loading…
Cancel
Save