try: if region: iam = connect_to_aws(boto.iam, region, **aws_connect_kwargs) else: iam = boto.iam.connection.IAMConnection(**aws_connect_kwargs) except boto.exception.NoAuthHandlerFound, e: module.fail_json(msg=str(e)) result = {} changed = False try: orig_group_list = [ gl['group_name'] for gl in iam.get_all_groups().list_groups_result.groups ] orig_user_list = [ ul['user_name'] for ul in iam.get_all_users().list_users_result.users ] orig_role_list = [ rl['role_name'] for rl in iam.list_roles().list_roles_response.list_roles_result.roles ] orig_prof_list = [ ap['instance_profile_name'] for ap in iam.list_instance_profiles().list_instance_profiles_response.
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module) try: if region: iam = boto.iam.connect_to_region(region, **aws_connect_kwargs) else: iam = boto.iam.connection.IAMConnection(**aws_connect_kwargs) except boto.exception.NoAuthHandlerFound, e: module.fail_json(msg=str(e)) result = {} changed = False try: orig_group_list = [gl['group_name'] for gl in iam.get_all_groups(). list_groups_result. groups] orig_user_list = [ul['user_name'] for ul in iam.get_all_users(). list_users_result. users] orig_role_list = [rl['role_name'] for rl in iam.list_roles().list_roles_response. list_roles_result. roles] orig_prof_list = [ap['instance_profile_name'] for ap in iam.list_instance_profiles(). list_instance_profiles_response. list_instance_profiles_result. instance_profiles] except boto.exception.BotoServerError, err:
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module) try: if region: iam = boto.iam.connect_to_region(region, **aws_connect_kwargs) else: iam = boto.iam.connection.IAMConnection(**aws_connect_kwargs) except boto.exception.NoAuthHandlerFound, e: module.fail_json(msg=str(e)) result = {} changed = False try: orig_group_list = [gl['group_name'] for gl in iam.get_all_groups(). list_groups_result. groups] orig_user_list = [ul['user_name'] for ul in iam.get_all_users(). list_users_result. users] orig_role_list = [rl['role_name'] for rl in iam.list_roles().list_roles_response. list_roles_result. roles] orig_prof_list = [ap['instance_profile_name'] for ap in iam.list_instance_profiles(). list_instance_profiles_response. list_instance_profiles_result. instance_profiles] except boto.exception.BotoServerError, err: