class LambdaDestination
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Logs.Destinations.LambdaDestination |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslogsdestinations#LambdaDestination |
![]() | software.amazon.awscdk.services.logs.destinations.LambdaDestination |
![]() | aws_cdk.aws_logs_destinations.LambdaDestination |
![]() | aws-cdk-lib » aws_logs_destinations » LambdaDestination |
Implements
ILog
Use a Lambda Function as the destination for a log subscription.
Example
import * as destinations from 'aws-cdk-lib/aws-logs-destinations';
declare const fn: lambda.Function;
declare const logGroup: logs.LogGroup;
new logs.SubscriptionFilter(this, 'Subscription', {
logGroup,
destination: new destinations.LambdaDestination(fn),
filterPattern: logs.FilterPattern.allTerms("ERROR", "MainThread"),
filterName: 'ErrorInMainThread',
});
Initializer
new LambdaDestination(fn: IFunction, options?: LambdaDestinationOptions)
Parameters
- fn
IFunction
- options
Lambda
Destination Options
LambdaDestinationOptions.
Methods
Name | Description |
---|---|
bind(scope, logGroup) | Return the properties required to send subscription events to this destination. |
bind(scope, logGroup)
public bind(scope: Construct, logGroup: ILogGroup): LogSubscriptionDestinationConfig
Parameters
Returns
Return the properties required to send subscription events to this destination.
If necessary, the destination can use the properties of the SubscriptionFilter object itself to configure its permissions to allow the subscription to write to it.
The destination may reconfigure its own permissions in response to this function call.