def create_security_group
      aws_ec2 = ec2_obj

      name = nil

      loop do
        name = 'chef-workflow-' + (0..rand(10).to_i).map { rand(0..9).to_s }.join("")

        if_debug(3) do
          $stderr.puts "Seeing if security group name #{name} is taken"
        end

        break unless aws_ec2.security_groups.filter('group-name', [name]).first
        sleep 0.3
      end

      group = aws_ec2.security_groups.create(name)

      security_group_open_ports.each do |port|
        group.authorize_ingress(:tcp, port)
        group.authorize_ingress(:udp, port)
      end

      group.authorize_ingress(:tcp, (0..65535), group)
      group.authorize_ingress(:udp, (0..65535), group)

      # XXX I think the name should be enough, but maybe this'll cause a problem.
      File.binwrite(security_group_setting_path, Marshal.dump([name]))
      return [name]
    end
def create_security_group
      aws_ec2 = ec2_obj

      name = nil

      loop do
        name = 'chef-workflow-' + (0..rand(10).to_i).map { rand(0..9).to_s }.join("")

        if_debug(3) do
          $stderr.puts "Seeing if security group name #{name} is taken"
        end

        break unless aws_ec2.security_groups.filter('group-name', [name]).first
        sleep 0.3
      end

      group = aws_ec2.security_groups.create(name)

      security_group_open_ports.each do |port|
        group.authorize_ingress(:tcp, port)
        group.authorize_ingress(:udp, port)
      end

      group.authorize_ingress(:tcp, (0..65535), group)
      group.authorize_ingress(:udp, (0..65535), group)

      # XXX I think the name should be enough, but maybe this'll cause a problem.
      File.binwrite(security_group_setting_path, Marshal.dump([name]))
      return [name]
    end
Creates a security group and saves it to the security_group_setting_path.