|
|
|
|
@ -13,6 +13,7 @@ import (
|
|
|
|
|
type StepSecurityGroup struct {
|
|
|
|
|
SecurityGroupId string
|
|
|
|
|
SSHPort int
|
|
|
|
|
VpcId string
|
|
|
|
|
|
|
|
|
|
createdGroupId string
|
|
|
|
|
}
|
|
|
|
|
@ -35,7 +36,12 @@ func (s *StepSecurityGroup) Run(state map[string]interface{}) multistep.StepActi
|
|
|
|
|
ui.Say("Creating temporary security group for this instance...")
|
|
|
|
|
groupName := fmt.Sprintf("packer %s", hex.EncodeToString(identifier.NewUUID().Raw()))
|
|
|
|
|
log.Printf("Temporary group name: %s", groupName)
|
|
|
|
|
groupResp, err := ec2conn.CreateSecurityGroup(ec2.SecurityGroup{Name: groupName, Description: "Temporary group for Packer", VpcId: config.VpcId})
|
|
|
|
|
group := ec2.SecurityGroup{
|
|
|
|
|
Name: groupName,
|
|
|
|
|
Description: "Temporary group for Packer",
|
|
|
|
|
VpcId: s.VpcId,
|
|
|
|
|
}
|
|
|
|
|
groupResp, err := ec2conn.CreateSecurityGroup(group)
|
|
|
|
|
if err != nil {
|
|
|
|
|
ui.Error(err.Error())
|
|
|
|
|
return multistep.ActionHalt
|
|
|
|
|
|