Commit 2dace054 authored by Armon Dadgar's avatar Armon Dadgar

Merge pull request #1707 from gergnz/master

change ordering of ssh connection IP for amazon. fixes #1559
parents dd5de1e3 dbaf865e
...@@ -16,14 +16,14 @@ func SSHAddress(e *ec2.EC2, port int, private bool) func(multistep.StateBag) (st ...@@ -16,14 +16,14 @@ func SSHAddress(e *ec2.EC2, port int, private bool) func(multistep.StateBag) (st
for j := 0; j < 2; j++ { for j := 0; j < 2; j++ {
var host string var host string
i := state.Get("instance").(*ec2.Instance) i := state.Get("instance").(*ec2.Instance)
if i.DNSName != "" { if i.VpcId != "" {
host = i.DNSName
} else if i.VpcId != "" {
if i.PublicIpAddress != "" && !private { if i.PublicIpAddress != "" && !private {
host = i.PublicIpAddress host = i.PublicIpAddress
} else { } else {
host = i.PrivateIpAddress host = i.PrivateIpAddress
} }
} else if i.DNSName != "" {
host = i.DNSName
} }
if host != "" { if host != "" {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment