Merge pull request #1623 from hashicorp/b-private-ip-ssh

providers/aws: if no public IP, use private IP for SSH by default
This commit is contained in:
Mitchell Hashimoto 2015-04-22 16:02:04 +02:00
commit c1464b1c6d
1 changed files with 5 additions and 0 deletions

View File

@ -544,6 +544,11 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
"type": "ssh",
"host": *instance.PublicIPAddress,
})
} else if instance.PrivateIPAddress != nil {
d.SetConnInfo(map[string]string{
"type": "ssh",
"host": *instance.PrivateIPAddress,
})
}
// Set our attributes