Interface IStringConditions
Conditions that can be applied to string attributes.
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IStringConditions
Syntax (vb)
Public Interface IStringConditions
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
Properties
Allowlist | Match one or more values. |
Denylist | Match any value that doesn't include any of the specified values. |
MatchPrefixes | Matches values that begins with the specified prefixes. |
MatchSuffixes | Matches values that end with the specified suffixes. |
Properties
Allowlist
Match one or more values.
virtual string[] Allowlist { get; }
Property Value
System.String[]
Remarks
Default: - None
Denylist
Match any value that doesn't include any of the specified values.
virtual string[] Denylist { get; }
Property Value
System.String[]
Remarks
Default: - None
MatchPrefixes
Matches values that begins with the specified prefixes.
virtual string[] MatchPrefixes { get; }
Property Value
System.String[]
Remarks
Default: - None
MatchSuffixes
Matches values that end with the specified suffixes.
virtual string[] MatchSuffixes { get; }
Property Value
System.String[]
Remarks
Default: - None