@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.260Z") @Stability(value=Stable) public class LambdaSubscription extends software.amazon.jsii.JsiiObject implements ITopicSubscription
Example:
import software.amazon.awscdk.services.lambda.*;
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
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)
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=Stable)
public LambdaSubscription(@NotNull
IFunction fn,
@Nullable
LambdaSubscriptionProps props)
fn - This parameter is required.props - @Stability(value=Stable)
public LambdaSubscription(@NotNull
IFunction fn)
fn - This parameter is required.@Stability(value=Stable) @NotNull public TopicSubscriptionConfig bind(@NotNull ITopic topic)
bind in interface ITopicSubscriptiontopic - This parameter is required.Copyright © 2022. All rights reserved.