Class SubscriptionFilter
A subscription filter for an attribute.
Inheritance
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(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
SubscriptionFilter(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
SubscriptionFilter(Object[]) |
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(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected SubscriptionFilter(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
SubscriptionFilter(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected SubscriptionFilter(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
SubscriptionFilter(Object[])
public SubscriptionFilter(object[] conditions = null)
Parameters
- conditions System.Object[]
conditions that specify the message attributes that should be included, excluded, matched, etc.
Properties
Conditions
conditions that specify the message attributes that should be included, excluded, matched, etc.
public virtual object[] Conditions { get; }
Property Value
System.Object[]
Methods
ExistsFilter()
Returns a subscription filter for attribute key matching.
public static SubscriptionFilter ExistsFilter()
Returns
NumericFilter(INumericConditions)
Returns a subscription filter for a numeric attribute.
public static SubscriptionFilter NumericFilter(INumericConditions numericConditions)
Parameters
- numericConditions INumericConditions
Returns
StringFilter(IStringConditions)
Returns a subscription filter for a string attribute.
public static SubscriptionFilter StringFilter(IStringConditions stringConditions)
Parameters
- stringConditions IStringConditions
Returns