boto3 icon indicating copy to clipboard operation
boto3 copied to clipboard

AWS Lambda - "list_coverage" filter on `lambdaFunctionRuntime` not working

Open RegisGraptin opened this issue 6 months ago • 7 comments

Describe the bug

I am currently using AWS Lambda to retrieve the Lambda Function from AWS. I would like to apply a filter on it using the lambdaFunctionRuntime. However, when applying it, it seems the filter is not taken into consideration. For instance, I have the following filters (that I am using in filterCriteria for the list_coverage function):

{
    "resourceType": [
        {
            "comparison": "EQUALS",
            "value": "AWS_LAMBDA_FUNCTION"
        }
    ],
    "lambdaFunctionRuntime": [
        {
            "comparison": "EQUALS",
            "value": "PYTHON_3_9"
        },
        {
            "comparison": "EQUALS",
            "value": "PYTHON_3_8"
        }
    ]
}

However, when using it, I have a bunch of lambda resource with different runtime as node and other python version.

Expected Behavior

By applying the filter, I should only have lambda function resource with the runtime matching the configuration. If I took my previous example, in the API response, we should have PYTHON_3_9 and PYTHON_3_8.

Current Behavior

Currently, it seems the filter is not working for the list_coverage function on the lambdaFunctionRuntime.

Reproduction Steps

# I am using `boto3==1.34.111`

client = boto3.client("lambda", **params)

filters = defaultdict(list)
filters["resourceType"].append({"comparison": "EQUALS", "value": "AWS_LAMBDA_FUNCTION"})
filters["lambdaFunctionRuntime"].append({"comparison": "EQUALS", "value": "PYTHON_3_9"})
filters["lambdaFunctionRuntime"].append({"comparison": "EQUALS", "value": "PYTHON_3_8"})

for page in client.get_paginator("list_coverage").paginate(
    filterCriteria=filters,
):
    # FIXME :: Not expected filter on runtime

Possible Solution

I think it is related to the API endpoint, not taking into consideration this filter.

Additional Information/Context

No response

SDK version used

1.34.111

Environment details (OS name and version, etc.)

Ubuntu - Python 3.12.3

RegisGraptin avatar Aug 05 '24 09:08 RegisGraptin