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
a770a5b2
Commit
a770a5b2
authored
Dec 06, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #660 from CpuID/master
builder/amazon/ebs: AssociatePublicIpAddress for launching
parents
5d420ce1
e711255d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
56 deletions
+77
-56
builder/amazon/common/run_config.go
builder/amazon/common/run_config.go
+15
-14
builder/amazon/common/ssh.go
builder/amazon/common/ssh.go
+5
-1
builder/amazon/common/step_run_source_instance.go
builder/amazon/common/step_run_source_instance.go
+27
-21
builder/amazon/ebs/builder.go
builder/amazon/ebs/builder.go
+11
-10
builder/amazon/instance/builder.go
builder/amazon/instance/builder.go
+11
-10
website/source/docs/builders/amazon-ebs.html.markdown
website/source/docs/builders/amazon-ebs.html.markdown
+4
-0
website/source/docs/builders/amazon-instance.html.markdown
website/source/docs/builders/amazon-instance.html.markdown
+4
-0
No files found.
builder/amazon/common/run_config.go
View file @
a770a5b2
...
@@ -22,6 +22,7 @@ type RunConfig struct {
...
@@ -22,6 +22,7 @@ type RunConfig struct {
SecurityGroupId
string
`mapstructure:"security_group_id"`
SecurityGroupId
string
`mapstructure:"security_group_id"`
SecurityGroupIds
[]
string
`mapstructure:"security_group_ids"`
SecurityGroupIds
[]
string
`mapstructure:"security_group_ids"`
SubnetId
string
`mapstructure:"subnet_id"`
SubnetId
string
`mapstructure:"subnet_id"`
AssociatePublicIpAddress
bool
`mapstructure:"associate_public_ip_address"`
TemporaryKeyPairName
string
`mapstructure:"temporary_key_pair_name"`
TemporaryKeyPairName
string
`mapstructure:"temporary_key_pair_name"`
VpcId
string
`mapstructure:"vpc_id"`
VpcId
string
`mapstructure:"vpc_id"`
AvailabilityZone
string
`mapstructure:"availability_zone"`
AvailabilityZone
string
`mapstructure:"availability_zone"`
...
...
builder/amazon/common/ssh.go
View file @
a770a5b2
...
@@ -20,8 +20,12 @@ func SSHAddress(e *ec2.EC2, port int) func(multistep.StateBag) (string, error) {
...
@@ -20,8 +20,12 @@ func SSHAddress(e *ec2.EC2, port int) func(multistep.StateBag) (string, error) {
if
i
.
DNSName
!=
""
{
if
i
.
DNSName
!=
""
{
host
=
i
.
DNSName
host
=
i
.
DNSName
}
else
if
i
.
VpcId
!=
""
{
}
else
if
i
.
VpcId
!=
""
{
if
i
.
PublicIpAddress
!=
""
{
host
=
i
.
PublicIpAddress
}
else
{
host
=
i
.
PrivateIpAddress
host
=
i
.
PrivateIpAddress
}
}
}
if
host
!=
""
{
if
host
!=
""
{
return
fmt
.
Sprintf
(
"%s:%d"
,
host
,
port
),
nil
return
fmt
.
Sprintf
(
"%s:%d"
,
host
,
port
),
nil
...
...
builder/amazon/common/step_run_source_instance.go
View file @
a770a5b2
...
@@ -18,6 +18,7 @@ type StepRunSourceInstance struct {
...
@@ -18,6 +18,7 @@ type StepRunSourceInstance struct {
SourceAMI
string
SourceAMI
string
IamInstanceProfile
string
IamInstanceProfile
string
SubnetId
string
SubnetId
string
AssociatePublicIpAddress
bool
AvailabilityZone
string
AvailabilityZone
string
BlockDevices
BlockDevices
BlockDevices
BlockDevices
...
@@ -56,6 +57,7 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
...
@@ -56,6 +57,7 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
SecurityGroups
:
securityGroups
,
SecurityGroups
:
securityGroups
,
IamInstanceProfile
:
s
.
IamInstanceProfile
,
IamInstanceProfile
:
s
.
IamInstanceProfile
,
SubnetId
:
s
.
SubnetId
,
SubnetId
:
s
.
SubnetId
,
AssociatePublicIpAddress
:
s
.
AssociatePublicIpAddress
,
BlockDevices
:
s
.
BlockDevices
.
BuildLaunchDevices
(),
BlockDevices
:
s
.
BlockDevices
.
BuildLaunchDevices
(),
AvailZone
:
s
.
AvailabilityZone
,
AvailZone
:
s
.
AvailabilityZone
,
}
}
...
@@ -114,6 +116,10 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
...
@@ -114,6 +116,10 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
ui
.
Message
(
fmt
.
Sprintf
(
"Public DNS: %s"
,
s
.
instance
.
DNSName
))
ui
.
Message
(
fmt
.
Sprintf
(
"Public DNS: %s"
,
s
.
instance
.
DNSName
))
}
}
if
s
.
instance
.
PublicIpAddress
!=
""
{
ui
.
Message
(
fmt
.
Sprintf
(
"Public IP: %s"
,
s
.
instance
.
PublicIpAddress
))
}
if
s
.
instance
.
PrivateIpAddress
!=
""
{
if
s
.
instance
.
PrivateIpAddress
!=
""
{
ui
.
Message
(
fmt
.
Sprintf
(
"Private IP: %s"
,
s
.
instance
.
PrivateIpAddress
))
ui
.
Message
(
fmt
.
Sprintf
(
"Private IP: %s"
,
s
.
instance
.
PrivateIpAddress
))
}
}
...
...
builder/amazon/ebs/builder.go
View file @
a770a5b2
...
@@ -101,6 +101,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -101,6 +101,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
SourceAMI
:
b
.
config
.
SourceAmi
,
SourceAMI
:
b
.
config
.
SourceAmi
,
IamInstanceProfile
:
b
.
config
.
IamInstanceProfile
,
IamInstanceProfile
:
b
.
config
.
IamInstanceProfile
,
SubnetId
:
b
.
config
.
SubnetId
,
SubnetId
:
b
.
config
.
SubnetId
,
AssociatePublicIpAddress
:
b
.
config
.
AssociatePublicIpAddress
,
AvailabilityZone
:
b
.
config
.
AvailabilityZone
,
AvailabilityZone
:
b
.
config
.
AvailabilityZone
,
BlockDevices
:
b
.
config
.
BlockDevices
,
BlockDevices
:
b
.
config
.
BlockDevices
,
},
},
...
...
builder/amazon/instance/builder.go
View file @
a770a5b2
...
@@ -204,6 +204,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -204,6 +204,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
UserDataFile
:
b
.
config
.
UserDataFile
,
UserDataFile
:
b
.
config
.
UserDataFile
,
SourceAMI
:
b
.
config
.
SourceAmi
,
SourceAMI
:
b
.
config
.
SourceAmi
,
SubnetId
:
b
.
config
.
SubnetId
,
SubnetId
:
b
.
config
.
SubnetId
,
AssociatePublicIpAddress
:
b
.
config
.
AssociatePublicIpAddress
,
AvailabilityZone
:
b
.
config
.
AvailabilityZone
,
AvailabilityZone
:
b
.
config
.
AvailabilityZone
,
BlockDevices
:
b
.
config
.
BlockDevices
,
BlockDevices
:
b
.
config
.
BlockDevices
,
},
},
...
...
website/source/docs/builders/amazon-ebs.html.markdown
View file @
a770a5b2
...
@@ -111,6 +111,10 @@ Optional:
...
@@ -111,6 +111,10 @@ Optional:
*
`subnet_id`
(string) - If using VPC, the ID of the subnet, such as
*
`subnet_id`
(string) - If using VPC, the ID of the subnet, such as
"subnet-12345def", where Packer will launch the EC2 instance.
"subnet-12345def", where Packer will launch the EC2 instance.
*
`associate_public_ip_address`
(bool) - If using a non-default VPC, public
IP addresses are not provided by default. If this is toggled, your new
instance will get a Public IP.
*
`tags`
(object of key/value strings) - Tags applied to the AMI.
*
`tags`
(object of key/value strings) - Tags applied to the AMI.
*
`user_data`
(string) - User data to apply when launching the instance.
*
`user_data`
(string) - User data to apply when launching the instance.
...
...
website/source/docs/builders/amazon-instance.html.markdown
View file @
a770a5b2
...
@@ -150,6 +150,10 @@ Optional:
...
@@ -150,6 +150,10 @@ Optional:
*
`subnet_id`
(string) - If using VPC, the ID of the subnet, such as
*
`subnet_id`
(string) - If using VPC, the ID of the subnet, such as
"subnet-12345def", where Packer will launch the EC2 instance.
"subnet-12345def", where Packer will launch the EC2 instance.
*
`associate_public_ip_address`
(bool) - If using a non-default VPC, public
IP addresses are not provided by default. If this is toggled, your new
instance will get a Public IP.
*
`tags`
(object of key/value strings) - Tags applied to the AMI.
*
`tags`
(object of key/value strings) - Tags applied to the AMI.
*
`user_data`
(string) - User data to apply when launching the instance.
*
`user_data`
(string) - User data to apply when launching the instance.
...
...
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