Merge pull request #253 from phobos182/master

builder/amazon/common: added passing UserData to goamz.
This commit is contained in:
Mitchell Hashimoto 2013-08-12 11:36:15 -07:00
commit 4e300259c7
4 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,7 @@ type RunConfig struct {
SourceAmi string `mapstructure:"source_ami"`
IamInstanceProfile string `mapstructure:"iam_instance_profile"`
InstanceType string `mapstructure:"instance_type"`
UserData string `mapstructure:"user_data"`
RawSSHTimeout string `mapstructure:"ssh_timeout"`
SSHUsername string `mapstructure:"ssh_username"`
SSHPort int `mapstructure:"ssh_port"`

View File

@ -11,6 +11,7 @@ import (
type StepRunSourceInstance struct {
ExpectedRootDevice string
InstanceType string
UserData string
SourceAMI string
IamInstanceProfile string
SubnetId string
@ -28,6 +29,7 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
KeyName: keyName,
ImageId: s.SourceAMI,
InstanceType: s.InstanceType,
UserData: []byte(s.UserData),
MinCount: 0,
MaxCount: 0,
SecurityGroups: []ec2.SecurityGroup{ec2.SecurityGroup{Id: securityGroupId}},

View File

@ -114,6 +114,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepRunSourceInstance{
ExpectedRootDevice: "ebs",
InstanceType: b.config.InstanceType,
UserData: b.config.UserData,
SourceAMI: b.config.SourceAmi,
IamInstanceProfile: b.config.IamInstanceProfile,
SubnetId: b.config.SubnetId,

View File

@ -193,6 +193,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepRunSourceInstance{
ExpectedRootDevice: "instance-store",
InstanceType: b.config.InstanceType,
UserData: b.config.UserData,
SourceAMI: b.config.SourceAmi,
SubnetId: b.config.SubnetId,
},