Class LambdaSubscriptionProps
Properties for a Lambda subscription.
Inheritance
System.Object
LambdaSubscriptionProps
Namespace: Amazon.CDK.AWS.SNS.Subscriptions
Assembly: Amazon.CDK.AWS.SNS.Subscriptions.dll
Syntax (csharp)
public class LambdaSubscriptionProps : Object, ILambdaSubscriptionProps, ISubscriptionProps
Syntax (vb)
Public Class LambdaSubscriptionProps
Inherits Object
Implements ILambdaSubscriptionProps, ISubscriptionProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda;
Function fn;
var myTopic = new Topic(this, "MyTopic");
// Lambda should receive only message matching the following conditions on attributes:
// color: 'red' or 'orange' or begins with 'bl'
// size: anything but 'small' or 'medium'
// price: between 100 and 200 or greater than 300
// store: attribute must be present
myTopic.AddSubscription(new LambdaSubscription(fn, new LambdaSubscriptionProps {
FilterPolicy = new Dictionary<string, SubscriptionFilter> {
{ "color", SubscriptionFilter.StringFilter(new StringConditions {
Allowlist = new [] { "red", "orange" },
MatchPrefixes = new [] { "bl" }
}) },
{ "size", SubscriptionFilter.StringFilter(new StringConditions {
Denylist = new [] { "small", "medium" }
}) },
{ "price", SubscriptionFilter.NumericFilter(new NumericConditions {
Between = new BetweenCondition { Start = 100, Stop = 200 },
GreaterThan = 300
}) },
{ "store", SubscriptionFilter.ExistsFilter() }
}
}));
Synopsis
Constructors
LambdaSubscriptionProps() |
Properties
DeadLetterQueue | Queue to be used as dead letter queue. |
FilterPolicy | The filter policy. |
Constructors
LambdaSubscriptionProps()
public LambdaSubscriptionProps()
Properties
DeadLetterQueue
Queue to be used as dead letter queue.
public IQueue DeadLetterQueue { get; set; }
Property Value
Remarks
If not passed no dead letter queue is enabled.
Default: - No dead letter queue enabled.
FilterPolicy
The filter policy.
public IDictionary<string, SubscriptionFilter> FilterPolicy { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, SubscriptionFilter>
Remarks
Default: - all messages are delivered