def convert_to_group_ids(groups, vpc_id, 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:
        if re.match('sg-.*', group):
            log.debug('group {0} is a group id. get_group_id not called.'
                      .format(group))
            group_ids.append(group)
        else:
            log.debug('calling boto_secgroup.get_group_id for'
                      ' group name {0}'.format(group))
            group_id = get_group_id(name=group, vpc_id=vpc_id,
                                    vpc_name=vpc_name, region=region,
                                    key=key, keyid=keyid, profile=profile)
            log.debug('group name {0} has group id {1}'.format(
                group, group_id)
            )
            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, convert_to_group_ids will
dataset/ETHPy150Open saltstack/salt/salt/modules/boto_secgroup.py/convert_to_group_ids