Interface ILambdaFunctionProps
Customize the Lambda Event Target.
Inherited Members
Namespace: Amazon.CDK.AWS.Events.Targets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ILambdaFunctionProps : ITargetBaseProps
Syntax (vb)
Public Interface ILambdaFunctionProps
Inherits ITargetBaseProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda;
var fn = new Function(this, "MyFunc", new FunctionProps {
Runtime = Runtime.NODEJS_LATEST,
Handler = "index.handler",
Code = Code.FromInline("exports.handler = handler.toString()")
});
var rule = new Rule(this, "rule", new RuleProps {
EventPattern = new EventPattern {
Source = new [] { "aws.ec2" }
}
});
var queue = new Queue(this, "Queue");
rule.AddTarget(new LambdaFunction(fn, new LambdaFunctionProps {
DeadLetterQueue = queue, // Optional: add a dead letter queue
MaxEventAge = Duration.Hours(2), // Optional: set the maxEventAge retry policy
RetryAttempts = 2
}));
Synopsis
Properties
Event | The event to send to the Lambda. |
Properties
Event
The event to send to the Lambda.
virtual RuleTargetInput Event { get; }
Property Value
Remarks
This will be the payload sent to the Lambda Function.
Default: the entire EventBridge event