Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
110fd0e1
Commit
110fd0e1
authored
Jul 21, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon/common: SSH into private IP if in VPC
parent
dd1c4d4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
builder/amazon/common/ssh.go
builder/amazon/common/ssh.go
+8
-1
No files found.
builder/amazon/common/ssh.go
View file @
110fd0e1
...
...
@@ -11,8 +11,15 @@ import (
// for determining the SSH address based on the instance DNS name.
func
SSHAddress
(
port
int
)
func
(
map
[
string
]
interface
{})
(
string
,
error
)
{
return
func
(
state
map
[
string
]
interface
{})
(
string
,
error
)
{
var
host
string
instance
:=
state
[
"instance"
]
.
(
*
ec2
.
Instance
)
return
fmt
.
Sprintf
(
"%s:%d"
,
instance
.
DNSName
,
port
),
nil
if
instance
.
VpcId
!=
""
{
host
=
instance
.
PrivateIpAddress
}
else
{
host
=
instance
.
DNSName
}
return
fmt
.
Sprintf
(
"%s:%d"
,
host
,
port
),
nil
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment