awslabs / aws-support-tools

Tools and sample code provided by AWS Premium Support.
https://aws.amazon.com/premiumsupport/
Apache License 2.0
1.45k stars 798 forks source link

CheckFunctionConcurrency only shows first 50 result #207

Open saddafk opened 2 years ago

saddafk commented 2 years ago

The CheckFunctionConcurrency.py only shows first 50 result, you have to use paginate to get all the function names

replace line #62 with below

paginator = client.get_paginator('list_functions') response_iterator = paginator.paginate()

Replace the next for loop with below

for function in response_iterator: if "NextMarker" in function:

print(function['NextMarker'])

    response_iterator = paginator.paginate(
                        PaginationConfig={
                                            'StartingToken': function['NextMarker']
                                                            }
                                      )
function_list=function['Functions']
i=0
for i in range(len(function_list)):
    functionList.append(function_list[i]['FunctionName'])