Show / Hide Table of Contents

Class SubscriptionFilter

A subscription filter for an attribute.

Inheritance
object
SubscriptionFilter
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class SubscriptionFilter : DeputyBase
Syntax (vb)
Public Class SubscriptionFilter Inherits DeputyBase
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" },
                        MatchSuffixes = new [] { "ue" }
                    }) },
                    { "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

SubscriptionFilter(object[]?)

A subscription filter for an attribute.

Properties

Conditions

conditions that specify the message attributes that should be included, excluded, matched, etc.

Methods

ExistsFilter()

Returns a subscription filter for attribute key matching.

NumericFilter(INumericConditions)

Returns a subscription filter for a numeric attribute.

StringFilter(IStringConditions)

Returns a subscription filter for a string attribute.

Constructors

SubscriptionFilter(object[]?)

A subscription filter for an attribute.

public SubscriptionFilter(object[]? conditions = null)
Parameters
conditions object[]

conditions that specify the message attributes that should be included, excluded, matched, etc.

Remarks

ExampleMetadata: infused

Properties

Conditions

conditions that specify the message attributes that should be included, excluded, matched, etc.

public virtual object[] Conditions { get; }
Property Value

object[]

Remarks

ExampleMetadata: infused

Methods

ExistsFilter()

Returns a subscription filter for attribute key matching.

public static SubscriptionFilter ExistsFilter()
Returns

SubscriptionFilter

Remarks

ExampleMetadata: infused

NumericFilter(INumericConditions)

Returns a subscription filter for a numeric attribute.

public static SubscriptionFilter NumericFilter(INumericConditions numericConditions)
Parameters
numericConditions INumericConditions
Returns

SubscriptionFilter

Remarks

ExampleMetadata: infused

StringFilter(IStringConditions)

Returns a subscription filter for a string attribute.

public static SubscriptionFilter StringFilter(IStringConditions stringConditions)
Parameters
stringConditions IStringConditions
Returns

SubscriptionFilter

Remarks

ExampleMetadata: infused

Back to top Generated by DocFX