aws-cdk-lib.aws_lambda_destinations.LambdaDestinationOptions

interface LambdaDestinationOptions

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

Options for 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,
  }),
})

Properties

NameTypeDescription
responseOnly?booleanWhether the destination function receives only the responsePayload of the source function.

responseOnly?

Type: boolean (optional, default: false The destination function receives the full invocation record.)

Whether the destination function receives only the responsePayload of the source function.

When set to true and used as onSuccess destination, the destination function will be invoked with the payload returned by the source function.

When set to true and used as onFailure destination, the destination function will be invoked with the error object returned by source function.

See the README of this module to see a full explanation of this option.