import boto3 from botocore.exceptions import ClientError # List of AWS CLI profiles aws_profiles = [ 'gdb-apollo-dev', 'gdb-artistapp-dev', 'gdb-core-dev', 'gdb-databricks-dev', 'gdb-datasci-dev', 'gdb-delphi-dev', 'gdb-infra-dev', 'gdb-mct-dev', 'gdb-prodhub-dev', 'gdb-apollo-prod', 'gdb-artistapp-prod', 'gdb-core-prod', 'gdb-databricks-prod', 'gdb-delphi-prod', 'gdb-infra-prod', 'gdb-mct-prod', 'gdb-whitelist-dev', 'gdb-whitelist-prod', #'gdb-legacy-prod', 'gdb-smu-dev', 'gdb-smu-prod', ] regions = ['us-east-1', 'eu-west-1', 'eu-central-1'] # Set up a dictionary to store unique runtimes unique_runtimes = {} # Iterate over AWS profiles for profile in aws_profiles: for region in regions: # Create a session using the profile session = boto3.Session(profile_name=profile, region_name=region) lambda_client = session.client('lambda') # Get all Lambda functions try: response = lambda_client.list_functions() # Extract unique runtimes for function in response['Functions']: runtime = function.get('Runtime', 'Docker') unique_runtimes[runtime] = True except ClientError: pass # Print unique runtimes print("Unique Lambda Runtimes:") for runtime in unique_runtimes.keys(): print(runtime)