diff --git a/builder/googlecompute/ssh.go b/builder/googlecompute/ssh.go index e498ed43b..3de529eeb 100644 --- a/builder/googlecompute/ssh.go +++ b/builder/googlecompute/ssh.go @@ -5,6 +5,10 @@ import ( ) func commHost(state multistep.StateBag) (string, error) { + config := state.Get("config").(*Config) + if config.Comm.SSHHost != "" { + return config.Comm.SSHHost, nil + } ipAddress := state.Get("instance_ip").(string) return ipAddress, nil }