# LambdaDestination

Use a Lambda function as a Lambda destination.

Extends: LambdaDestination
Implements: IDestination

- Source: [`aws-lambda-destinations/lib/lambda.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-lambda-destinations/lib/lambda.ts#L33)

## Example

```ts
// Auto-extract response payload with a lambda destination
declare const destinationFn: lambda.Function;

const sourceFn = new lambda.Function(this, 'Source', {
  runtime: lambda.Runtime.NODEJS_LATEST,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
  // auto-extract on success
  onSuccess: new destinations.LambdaDestination(destinationFn, {
    responseOnly: true,
  }),
})
```

## Initializer

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

## Methods

- `bind(scope: Construct, fn: IFunction, options?: DestinationOptions): DestinationConfig` — Returns a destination configuration.
