This commit is contained in:
Mitchell Hashimoto 2013-07-21 22:46:58 -07:00
parent a5546fa0f3
commit b9b5de5684
3 changed files with 7 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import (
type StepSecurityGroup struct {
SecurityGroupId string
SSHPort int
VpcId string
VpcId string
createdGroupId string
}
@ -37,9 +37,9 @@ func (s *StepSecurityGroup) Run(state map[string]interface{}) multistep.StepActi
groupName := fmt.Sprintf("packer %s", hex.EncodeToString(identifier.NewUUID().Raw()))
log.Printf("Temporary group name: %s", groupName)
group := ec2.SecurityGroup{
Name: groupName,
Name: groupName,
Description: "Temporary group for Packer",
VpcId: s.VpcId,
VpcId: s.VpcId,
}
groupResp, err := ec2conn.CreateSecurityGroup(group)
if err != nil {

View File

@ -92,12 +92,13 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepSecurityGroup{
SecurityGroupId: b.config.SecurityGroupId,
SSHPort: b.config.SSHPort,
VpcId: b.config.VpcId,
},
&awscommon.StepRunSourceInstance{
ExpectedRootDevice: "ebs",
InstanceType: b.config.InstanceType,
SourceAMI: b.config.SourceAmi,
SubnetId: b.config.SubnetId,
SubnetId: b.config.SubnetId,
},
&common.StepConnectSSH{
SSHAddress: awscommon.SSHAddress(b.config.SSHPort),

View File

@ -98,12 +98,13 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepSecurityGroup{
SecurityGroupId: b.config.SecurityGroupId,
SSHPort: b.config.SSHPort,
VpcId: b.config.VpcId,
},
&awscommon.StepRunSourceInstance{
ExpectedRootDevice: "instance-store",
InstanceType: b.config.InstanceType,
SourceAMI: b.config.SourceAmi,
SubnetId: b.config.SubnetId,
SubnetId: b.config.SubnetId,
},
&common.StepConnectSSH{
SSHAddress: awscommon.SSHAddress(b.config.SSHPort),