From dbaf865e59c2a87198c461b79f57f0d6c8165947 Mon Sep 17 00:00:00 2001 From: Greg Cockburn Date: Mon, 1 Dec 2014 10:44:52 +1100 Subject: [PATCH] change ordering of ssh connection IP for amazon. fixes #1559 --- builder/amazon/common/ssh.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/amazon/common/ssh.go b/builder/amazon/common/ssh.go index 34fd746cb..f31437d89 100644 --- a/builder/amazon/common/ssh.go +++ b/builder/amazon/common/ssh.go @@ -16,14 +16,14 @@ func SSHAddress(e *ec2.EC2, port int, private bool) func(multistep.StateBag) (st for j := 0; j < 2; j++ { var host string i := state.Get("instance").(*ec2.Instance) - if i.DNSName != "" { - host = i.DNSName - } else if i.VpcId != "" { + if i.VpcId != "" { if i.PublicIpAddress != "" && !private { host = i.PublicIpAddress } else { host = i.PrivateIpAddress } + } else if i.DNSName != "" { + host = i.DNSName } if host != "" {