nitpick, this method could be written as:

    groups = client.security_groups
    groups.reject! { |sg| sg.vpc_id != vpc } if vpc
    groups