FilterRule

class aws_cdk.aws_lambda.FilterRule

Bases: object

Filter rules for Lambda event filtering.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_lambda_event_sources as eventsources
import aws_cdk.aws_dynamodb as dynamodb

# fn: lambda.Function

table = dynamodb.Table(self, "Table",
    partition_key=dynamodb.Attribute(
        name="id",
        type=dynamodb.AttributeType.STRING
    ),
    stream=dynamodb.StreamViewType.NEW_IMAGE
)
fn.add_event_source(eventsources.DynamoEventSource(table,
    starting_position=lambda_.StartingPosition.LATEST,
    filters=[lambda_.FilterCriteria.filter({"event_name": lambda_.FilterRule.is_equal("INSERT")})]
))

Static Methods

classmethod begins_with(elem)

Begins with comparison operator.

Parameters:

elem (str) –

Return type:

List[Mapping[str, str]]

classmethod between(first, second)

Numeric range comparison operator.

Parameters:
  • first (Union[int, float]) –

  • second (Union[int, float]) –

Return type:

List[Mapping[str, List[Any]]]

classmethod empty()

Empty comparison operator.

Return type:

List[str]

classmethod exists()

Exists comparison operator.

Return type:

List[Mapping[str, bool]]

classmethod is_equal(item)

Equals comparison operator.

Parameters:

item (Union[str, int, float]) –

Return type:

Any

classmethod not_equals(elem)

Not equals comparison operator.

Parameters:

elem (str) –

Return type:

List[Mapping[str, List[str]]]

classmethod not_exists()

Not exists comparison operator.

Return type:

List[Mapping[str, bool]]

classmethod null()

Null comparison operator.

Return type:

List[str]

classmethod or_(*elem)

Or comparison operator.

Parameters:

elem (str) –

Return type:

List[str]