def get_ec2_instances(project: str, ec2):
    """Return ec2 instances for project"""
    if project:
        filters = [{"Name": "tag:PROJECT", "Values": [project]}]
        return ec2.instances.filter(Filters=filters)
    else:
        return ec2.instances.all()