def find_igw(vpc_conn, vpc_id):
 igw = vpc_conn.get_all_internet_gateways(filters={'attachment.vpc-id': vpc_id})
 if (not igw):
  raise AnsibleIgwSearchException('No IGW found for VPC {0}'.format(vpc_id))
 elif (len(igw) == 1):
  return igw[0].id
 else:
  raise AnsibleIgwSearchException('Multiple IGWs found for VPC {0}'.format(vpc_id))

def find_igw ( vpc_conn , vpc_id ) : igw = vpc_conn . get_all_internet_gateways ( filters = { 'attachment.vpc-id' : vpc_id } ) if ( not igw ) : raise AnsibleIgwSearchException ( 'No IGW found for VPC {0}' . format ( vpc_id ) ) elif ( len ( igw ) == 1 ) : return igw [ 0 ] . id else : raise AnsibleIgwSearchException ( 'Multiple IGWs found for VPC {0}' . format ( vpc_id ) )
finds the internet gateway for the given vpc id .