Interface LambdaFunctionProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,TargetBaseProps
- All Known Implementing Classes:
LambdaFunctionProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.739Z")
@Stability(Stable)
public interface LambdaFunctionProps
extends software.amazon.jsii.JsiiSerializable, TargetBaseProps
Customize the Lambda Event Target.
Example:
import software.amazon.awscdk.services.lambda.*; Function fn = Function.Builder.create(this, "MyFunc") .runtime(Runtime.NODEJS_14_X) .handler("index.handler") .code(Code.fromInline("exports.handler = handler.toString()")) .build(); Rule rule = Rule.Builder.create(this, "rule") .eventPattern(EventPattern.builder() .source(List.of("aws.ec2")) .build()) .build(); Queue queue = new Queue(this, "Queue"); rule.addTarget(LambdaFunction.Builder.create(fn) .deadLetterQueue(queue) // Optional: add a dead letter queue .maxEventAge(Duration.hours(2)) // Optional: set the maxEventAge retry policy .retryAttempts(2) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forLambdaFunctionProps
static final class
An implementation forLambdaFunctionProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic LambdaFunctionProps.Builder
builder()
default RuleTargetInput
getEvent()
The event to send to the Lambda.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods inherited from interface software.amazon.awscdk.services.events.targets.TargetBaseProps
getDeadLetterQueue, getMaxEventAge, getRetryAttempts
-
Method Details
-
getEvent
The event to send to the Lambda.This will be the payload sent to the Lambda Function.
Default: the entire EventBridge event
-
builder
- Returns:
- a
LambdaFunctionProps.Builder
ofLambdaFunctionProps
-