mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
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.
This commit is contained in:
parent
f9cea9edd1
commit
94bf981d3b
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Reference in a new issue