interface StringConditions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.SNS.StringConditions |
Java | software.amazon.awscdk.services.sns.StringConditions |
Python | aws_cdk.aws_sns.StringConditions |
TypeScript (source) | @aws-cdk/aws-sns » StringConditions |
Conditions that can be applied to string attributes.
Example
import * as lambda from '@aws-cdk/aws-lambda';
const myTopic = new sns.Topic(this, 'MyTopic');
declare const fn: lambda.Function;
// 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 subscriptions.LambdaSubscription(fn, {
filterPolicy: {
color: sns.SubscriptionFilter.stringFilter({
allowlist: ['red', 'orange'],
matchPrefixes: ['bl'],
}),
size: sns.SubscriptionFilter.stringFilter({
denylist: ['small', 'medium'],
}),
price: sns.SubscriptionFilter.numericFilter({
between: { start: 100, stop: 200 },
greaterThan: 300,
}),
store: sns.SubscriptionFilter.existsFilter(),
},
}));
Properties
Name | Type | Description |
---|---|---|
allowlist? | string[] | Match one or more values. |
blacklist? | string[] | Match any value that doesn't include any of the specified values. |
denylist? | string[] | Match any value that doesn't include any of the specified values. |
match | string[] | Matches values that begins with the specified prefixes. |
whitelist? | string[] | Match one or more values. |
allowlist?
Type:
string[]
(optional, default: None)
Match one or more values.
blacklist?
⚠️ Deprecated: use denylist
Type:
string[]
(optional, default: None)
Match any value that doesn't include any of the specified values.
denylist?
Type:
string[]
(optional, default: None)
Match any value that doesn't include any of the specified values.
matchPrefixes?
Type:
string[]
(optional, default: None)
Matches values that begins with the specified prefixes.
whitelist?
⚠️ Deprecated: use allowlist
Type:
string[]
(optional, default: None)
Match one or more values.