Skip to content

Commit

Permalink
Merge pull request #1623 from hashicorp/b-private-ip-ssh
Browse files Browse the repository at this point in the history
providers/aws: if no public IP, use private IP for SSH by default
  • Loading branch information
mitchellh committed Apr 22, 2015
2 parents 341b2ff + ec38a65 commit c1464b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/providers/aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c1464b1

Please sign in to comment.