"""make an iam type client connection"""
               iam = get_session.connect(
               role, 'iam')

               """
               call iam.list_policies() in multithreading mode 
               """
               thread_call = threading.Thread(
                    target=iam_helper.inventory_managed_policies, 
                    args=(iam, account, output_bucket, encode))
               multi_thread.append(thread_call)
               thread_call.start()

       """wait for all threads to finish"""
       for t in multi_thread:
           t.join()

       """output or export results"""
       if output_bucket:
           misc.output_lines(output_bucket)










Пример #2
0
                    role, 
                    'elb', 
                    region_name=region.get('RegionName'))

                    """make an ec2 type client connection"""
                    ec2 = get_session.connect(
                    role, 
                    'ec2', 
                    region_name=region.get('RegionName'))

                    """
                    call elb.describe_load_balancers() in multithreading mode 
                    for better performance. otherwise performance sucks.
                    """
                    thread_call = threading.Thread(
                         target=elb_helper.sg_rule_sets_by_elb, 
                         args=(elb, ec2, account, region, output_bucket))
                    multi_thread.append(thread_call)
                    thread_call.start()

        """wait for all threads to finish"""
        for t in multi_thread:
            t.join()

        """output or export results"""
        if output_bucket:
            misc.output_lines(output_bucket)