def convert_to_group_ids(groups, vpc_id=None, vpc_name=None, region=None, key=None, keyid=None, profile=None):
 log.debug('security group contents {0} pre-conversion'.format(groups))
 group_ids = []
 for group in groups:
  group_id = get_group_id(name=group, vpc_id=vpc_id, vpc_name=vpc_name, region=region, key=key, keyid=keyid, profile=profile)
  if (not group_id):
   raise CommandExecutionError('Could not resolve Security Group name {0} to a Group ID'.format(group))
  else:
   group_ids.append(str(group_id))
 log.debug('security group contents {0} post-conversion'.format(group_ids))
 return group_ids

def convert_to_group_ids ( groups , vpc_id = None , vpc_name = None , region = None , key = None , keyid = None , profile = None ) : log . debug ( 'security group contents {0} pre-conversion' . format ( groups ) ) group_ids = [ ] for group in groups : group_id = get_group_id ( name = group , vpc_id = vpc_id , vpc_name = vpc_name , region = region , key = key , keyid = keyid , profile = profile ) if ( not group_id ) : raise CommandExecutionError ( 'Could not resolve Security Group name {0} to a Group ID' . format ( group ) ) else : group_ids . append ( str ( group_id ) ) log . debug ( 'security group contents {0} post-conversion' . format ( group_ids ) ) return group_ids
given a list of security groups and a vpc_id .