class S3EventSourceV2
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Lambda.EventSources.S3EventSourceV2 |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslambdaeventsources#S3EventSourceV2 |
![]() | software.amazon.awscdk.services.lambda.eventsources.S3EventSourceV2 |
![]() | aws_cdk.aws_lambda_event_sources.S3EventSourceV2 |
![]() | aws-cdk-lib » aws_lambda_event_sources » S3EventSourceV2 |
Implements
IEvent
S3EventSourceV2 Use S3 bucket notifications as an event source for AWS Lambda.
Example
import * as s3 from 'aws-cdk-lib/aws-s3';
import { S3EventSourceV2 } from 'aws-cdk-lib/aws-lambda-event-sources';
const bucket = s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket');
declare const fn: lambda.Function;
fn.addEventSource(new S3EventSourceV2(bucket, {
events: [ s3.EventType.OBJECT_CREATED, s3.EventType.OBJECT_REMOVED ],
filters: [ { prefix: 'subdir/' } ], // optional
}));
Initializer
new S3EventSourceV2(bucket: IBucket, props: S3EventSourceProps)
Parameters
- bucket
IBucket
- props
S3
Event Source Props
Methods
Name | Description |
---|---|
bind(target) | Called by lambda.addEventSource to allow the event source to bind to this function. |
bind(target)
public bind(target: IFunction): void
Parameters
- target
IFunction
Called by lambda.addEventSource
to allow the event source to bind to this function.