SnsEventSourceProps

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

Bases: aws_cdk.aws_sns_subscriptions.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

Example:

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

# topic is of type Topic

# fn is of type 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.

Return type

Optional[IQueue]

filter_policy

The filter policy.

Default
  • all messages are delivered

Return type

Optional[Mapping[str, SubscriptionFilter]]