@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:15.202Z") @Stability(value=Experimental) public class LambdaSubscription extends software.amazon.jsii.JsiiObject implements ITopicSubscription
Example:
import software.amazon.awscdk.core.*;
Function fn;
Topic 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(LambdaSubscription.Builder.create(fn)
.filterPolicy(Map.of(
"color", SubscriptionFilter.stringFilter(StringConditions.builder()
.allowlist(List.of("red", "orange"))
.matchPrefixes(List.of("bl"))
.build()),
"size", SubscriptionFilter.stringFilter(StringConditions.builder()
.denylist(List.of("small", "medium"))
.build()),
"price", SubscriptionFilter.numericFilter(NumericConditions.builder()
.between(BetweenCondition.builder().start(100).stop(200).build())
.greaterThan(300)
.build()),
"store", SubscriptionFilter.existsFilter()))
.build());
| Modifier and Type | Class and Description |
|---|---|
static class |
LambdaSubscription.Builder
(experimental) A fluent builder for
LambdaSubscription. |
software.amazon.jsii.JsiiObject.InitializationModeITopicSubscription.Jsii$Default, ITopicSubscription.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
LambdaSubscription(IFunction fn) |
|
LambdaSubscription(IFunction fn,
LambdaSubscriptionProps props) |
protected |
LambdaSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
LambdaSubscription(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
TopicSubscriptionConfig |
bind(ITopic topic)
(experimental) Returns a configuration for a Lambda function to subscribe to an SNS topic.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected LambdaSubscription(software.amazon.jsii.JsiiObjectRef objRef)
protected LambdaSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public LambdaSubscription(@NotNull
IFunction fn,
@Nullable
LambdaSubscriptionProps props)
fn - This parameter is required.props - @Stability(value=Experimental)
public LambdaSubscription(@NotNull
IFunction fn)
fn - This parameter is required.@Stability(value=Experimental) @NotNull public TopicSubscriptionConfig bind(@NotNull ITopic topic)
bind in interface ITopicSubscriptiontopic - This parameter is required.Copyright © 2022. All rights reserved.