def get_or_make_group(ec2, name, vpc_id=None, quiet=False):
    """
    Get the EC2 security group of the given name,
    creating it if it doesn't exist
    """
    groups = ec2.security_groups.all()
    groups = [g for g in groups if g.group_name == name and g.vpc_id == vpc_id]
    if len(groups) > 0:
        return groups[0]
    else:
        if not quiet:
            print("Creating security group " + name)
        vpc_id = vpc_id if vpc_id is not None else ''
        sg = ec2.create_security_group(
            GroupName=name,
            Description='AbStar cluster group',
            VpcId=vpc_id)
        return sg