def is_peering_connection_pending(conn_id=None, conn_name=None, region=None, key=None, keyid=None, profile=None):
 if (not _exactly_one((conn_id, conn_name))):
  raise SaltInvocationError('Exactly one of conn_id or conn_name must be provided.')
 conn = _get_conn3(region=region, key=key, keyid=keyid, profile=profile)
 if conn_id:
  vpcs = conn.describe_vpc_peering_connections(VpcPeeringConnectionIds=[conn_id]).get('VpcPeeringConnections', [])
 else:
  filters = [{'Name': 'tag:Name', 'Values': [conn_name]}, {'Name': 'status-code', 'Values': [ACTIVE, PENDING_ACCEPTANCE, PROVISIONING]}]
  vpcs = conn.describe_vpc_peering_connections(Filters=filters).get('VpcPeeringConnections', [])
 if (not vpcs):
  return False
 elif (len(vpcs) > 1):
  raise SaltInvocationError('Found more than one ID for the VPC peering connection ({0}). Please call this function with an ID instead.'.format((conn_id or conn_name)))
 else:
  status = vpcs[0]['Status']['Code']
 return (status == PENDING_ACCEPTANCE)

def is_peering_connection_pending ( conn_id = None , conn_name = None , region = None , key = None , keyid = None , profile = None ) : if ( not _exactly_one ( ( conn_id , conn_name ) ) ) : raise SaltInvocationError ( 'Exactly one of conn_id or conn_name must be provided.' ) conn = _get_conn3 ( region = region , key = key , keyid = keyid , profile = profile ) if conn_id : vpcs = conn . describe_vpc_peering_connections ( VpcPeeringConnectionIds = [ conn_id ] ) . get ( 'VpcPeeringConnections' , [ ] ) else : filters = [ { 'Name' : 'tag:Name' , 'Values' : [ conn_name ] } , { 'Name' : 'status-code' , 'Values' : [ ACTIVE , PENDING_ACCEPTANCE , PROVISIONING ] } ] vpcs = conn . describe_vpc_peering_connections ( Filters = filters ) . get ( 'VpcPeeringConnections' , [ ] ) if ( not vpcs ) : return False elif ( len ( vpcs ) > 1 ) : raise SaltInvocationError ( 'Found more than one ID for the VPC peering connection ({0}). Please call this function with an ID instead.' . format ( ( conn_id or conn_name ) ) ) else : status = vpcs [ 0 ] [ 'Status' ] [ 'Code' ] return ( status == PENDING_ACCEPTANCE )
check if a vpc peering connection is in the pending state .