SnsEventSourceProps

class aws_cdk.aws_lambda_event_sources.SnsEventSourceProps(*, dead_letter_queue=None, filter_policy=None)

Bases: LambdaSubscriptionProps

Properties forwarded to the Lambda Subscription.

Parameters:
  • dead_letter_queue (Optional[IQueue]) – Queue to be used as dead letter queue. If not passed no dead letter queue is enabled. Default: - No dead letter queue enabled.

  • filter_policy (Optional[Mapping[str, SubscriptionFilter]]) – The filter policy. Default: - all messages are delivered

ExampleMetadata:

infused

Example:

import aws_cdk.aws_sns as sns
from aws_cdk.aws_lambda_event_sources import SnsEventSource

# topic: sns.Topic

# fn: lambda.Function

dead_letter_queue = sqs.Queue(self, "deadLetterQueue")
fn.add_event_source(SnsEventSource(topic,
    filter_policy={},
    dead_letter_queue=dead_letter_queue
))

Attributes

dead_letter_queue

Queue to be used as dead letter queue.

If not passed no dead letter queue is enabled.

Default:
  • No dead letter queue enabled.

filter_policy

The filter policy.

Default:
  • all messages are delivered