mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-21 15:31:41 -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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user