code: def _get_securitygroupname_id(securitygroupname_list):
      '''
      Returns the SecurityGroupId of a SecurityGroupName to use
      '''
      securitygroupid_set = set()
      if not isinstance(securitygroupname_list, list):
          securitygroupname_list = [securitygroupname_list]
      params = {'Action': 'DescribeSecurityGroups'}
      for sg in aws.query(params, location=get_location(),
                          provider=get_provider(), opts=__opts__, sigver='4'):
          if sg['groupName'] in securitygroupname_list:
              log.debug(
                  'AWS SecurityGroup ID of %s is %s',
                  sg['groupName'], sg['groupId']
              )
              securitygroupid_set.add(sg['groupId'])
      return list(securitygroupid_setf _get_securitygroupname_id(securitygroupname_list):
      '''
      Returns the SecurityGroupId of a SecurityGroupName to use
      '''
      securitygroupid_set = set()
      if not isinstance(securitygroupname_list, list):
          securitygroupname_list = [securitygroupname_list]
      params = {'Action': 'DescribeSecurityGroups'}
      for sg in aws.query(params, location=get_location(),
                          provider=get_provider(), opts=__opts__, sigver='4'):
          if sg['groupName'] in securitygroupname_list:
              log.debug(
                  'AWS SecurityGroup ID of %s is %s',
                  sg['groupName'], sg['groupId']
              )
              securitygroupid_set.add(sg['groupId'])
      return list(securitygroupid_set)
docs: Returns the SecurityGroupId of a SecurityGroupName to use