diff --git a/builder/amazon/common/ssh.go b/builder/amazon/common/ssh.go index d689d5990..fdf983368 100644 --- a/builder/amazon/common/ssh.go +++ b/builder/amazon/common/ssh.go @@ -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 }