aws-cdk-lib.aws_s3_notifications.LambdaDestination

class LambdaDestination

LanguageType name
.NETAmazon.CDK.AWS.S3.Notifications.LambdaDestination
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3notifications#LambdaDestination
Javasoftware.amazon.awscdk.services.s3.notifications.LambdaDestination
Pythonaws_cdk.aws_s3_notifications.LambdaDestination
TypeScript (source)aws-cdk-lib » aws_s3_notifications » LambdaDestination

Implements IBucketNotificationDestination

Use a Lambda function as a bucket notification destination.

Example

declare const myLambda: lambda.Function;
const bucket = s3.Bucket.fromBucketAttributes(this, 'ImportedBucket', {
  bucketArn: 'arn:aws:s3:::my-bucket',
});

// now you can just call methods on the bucket
bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(myLambda), {
  prefix: 'home/myusername/*',
});

Initializer

new LambdaDestination(fn: IFunction)

Parameters

  • fn IFunction

Methods

NameDescription
bind(_scope, bucket)Registers this resource to receive notifications for the specified bucket.

bind(_scope, bucket)

public bind(_scope: Construct, bucket: IBucket): BucketNotificationDestinationConfig

Parameters

  • _scope Construct
  • bucket IBucket

Returns

  • BucketNotificationDestinationConfig

Registers this resource to receive notifications for the specified bucket.

This method will only be called once for each destination/bucket pair and the result will be cached, so there is no need to implement idempotency in each destination.