aws-cdk-lib.aws_lambda_destinations.LambdaDestination

class LambdaDestination

LanguageType name
.NETAmazon.CDK.AWS.Lambda.Destinations.LambdaDestination
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambdadestinations#LambdaDestination
Javasoftware.amazon.awscdk.services.lambda.destinations.LambdaDestination
Pythonaws_cdk.aws_lambda_destinations.LambdaDestination
TypeScript (source)aws-cdk-lib » aws_lambda_destinations » LambdaDestination

Implements IDestination

Use a Lambda function as a Lambda destination.

Example

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

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

Initializer

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

Parameters

  • fn IFunction
  • options LambdaDestinationOptions

Methods

NameDescription
bind(scope, fn, options?)Returns a destination configuration.

bind(scope, fn, options?)

public bind(scope: Construct, fn: IFunction, options?: DestinationOptions): DestinationConfig

Parameters

  • scope Construct
  • fn IFunction
  • options DestinationOptions

Returns

  • DestinationConfig

Returns a destination configuration.