aws-cdk-lib.aws_logs_destinations.LambdaDestination

class LambdaDestination

LanguageType name
.NETAmazon.CDK.AWS.Logs.Destinations.LambdaDestination
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslogsdestinations#LambdaDestination
Javasoftware.amazon.awscdk.services.logs.destinations.LambdaDestination
Pythonaws_cdk.aws_logs_destinations.LambdaDestination
TypeScript (source)aws-cdk-lib » aws_logs_destinations » LambdaDestination

Implements ILogSubscriptionDestination

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"),
});

Initializer

new LambdaDestination(fn: IFunction, options?: LambdaDestinationOptions)

Parameters

  • fn IFunction
  • options LambdaDestinationOptions

LambdaDestinationOptions.

Methods

NameDescription
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

  • scope Construct
  • logGroup ILogGroup

Returns

  • LogSubscriptionDestinationConfig

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.