FilterCriteria

class aws_cdk.aws_lambda.FilterCriteria

Bases: object

Filter criteria for Lambda event filtering.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_dynamodb as dynamodb
from aws_cdk.aws_lambda_event_sources import DynamoEventSource

# table: dynamodb.Table

# fn: lambda.Function

fn.add_event_source(DynamoEventSource(table,
    starting_position=lambda_.StartingPosition.LATEST,
    filters=[
        lambda_.FilterCriteria.filter({
            "event_name": lambda_.FilterRule.is_equal("INSERT"),
            "dynamodb": {
                "NewImage": {
                    "id": {"BOOL": lambda_.FilterRule.is_equal(True)}
                }
            }
        })
    ]
))

Static Methods

classmethod filter(filter)

Filter for event source.

Parameters:

filter (Mapping[str, Any]) –

Return type:

Mapping[str, Any]