providers/aws: if no public IP, use private IP for SSH by default
This commit is contained in:
parent
a27890b1a6
commit
ec38a65dda
|
@ -544,6 +544,11 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
"type": "ssh",
|
"type": "ssh",
|
||||||
"host": *instance.PublicIPAddress,
|
"host": *instance.PublicIPAddress,
|
||||||
})
|
})
|
||||||
|
} else if instance.PrivateIPAddress != nil {
|
||||||
|
d.SetConnInfo(map[string]string{
|
||||||
|
"type": "ssh",
|
||||||
|
"host": *instance.PrivateIPAddress,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set our attributes
|
// Set our attributes
|
||||||
|
|
Loading…
Reference in New Issue