From ec38a65dda85311de26e81d760c54197ac6b0ff4 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 22 Apr 2015 12:25:28 +0200 Subject: [PATCH] providers/aws: if no public IP, use private IP for SSH by default --- builtin/providers/aws/resource_aws_instance.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/providers/aws/resource_aws_instance.go b/builtin/providers/aws/resource_aws_instance.go index e66e4444e..4c818af70 100644 --- a/builtin/providers/aws/resource_aws_instance.go +++ b/builtin/providers/aws/resource_aws_instance.go @@ -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